steward library

Classes

App
Container
Context
Form
Form is a base class for building your own forms. Please see the tests for examples on how they can be used.
FormError
FormError represents an error found by a form. You'll maybe want to extend this to provide your own error types, but its usable as is, too.
Headers
Models HTTP Headers that can be managed by the framework.
Jsonable
Processable
Request
Request models the request object that Steward processes. It is a wrapper around the HttpRequest object but this may change in future iterations. Generally, you will not need to new up a request object on your own, but may find that useful when working with middleware and/or intercepting incoming requests.
Response
Models an HTTP Response Steward processes this response and writes out the necessary data to the live HTTP response.
RouteBinding
Router
StewardContainer
A rudimentary DI container implementation container bindings are created as needed.
StewardContext

Functions

writeResponse(HttpRequest request, Future<Response> resp) Future<void>
writeResponse takes in an HTTP request and a steward response, and writes the contents of the steward response to the HTTP response. TODO: this should only be called by Steward

Typedefs

MiddlewareFunc = Future<Response> Function(Context) Function(Future<Response> nextHandler(Context))
MiddlewareFunc is a typedef that describes what a middleware function looks like. The main takeaway here is that this function takes in the next handler in the chain and returns a handlerm itself. This might sound confusing, but the implementation for this middleware pattern is likely not as bad as you may think! Check out the documentation for more information.
RequestCallback = Future<Response> Function(Context context)

Exceptions / Errors

AppConfigurationException