Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define core server types and interfaces #13

Closed
11 tasks
jbearer opened this issue Jun 11, 2022 · 0 comments · Fixed by #21
Closed
11 tasks

Define core server types and interfaces #13

jbearer opened this issue Jun 11, 2022 · 0 comments · Fixed by #21
Assignees

Comments

@jbearer
Copy link
Member

jbearer commented Jun 11, 2022

  • TideDisco<State, Error: net::Error + Into<tide::Error>> (should we call it something more descriptive like App or Server?)
    • new(state: State) -> Self
    • register_module<ModuleError: Into<Error>>(&mut self, base_url: Url, api: ApiSpec<State, ModuleError>) -> &mut Self
    • serve(self) -> JoinHandle<Result<()>>
  • ApiSpec<State, Error>
    • new(api: toml::Value) -> Result<Self>
    • route<T: Serialize>(&mut self, name: &str, handler: impl Fn(RequestParams<State>) -> Result<T, Error>) -> &mut Self
    • private register(self, app: &mut tide::App)
  • RequestParams<State>
    • state(&self) -> &State
    • param(&self, name: &str) -> Result<&UrlParam>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant