jaguar library

Main library that should be imported to write APIs using Jaguar

Classes

AuthorizationUser
BinaryFileFormField
Binary file field in the multipart/form-data
BinaryFileListFormField
ByteResponse
Response that writes the bytes provided in value to the response.
CastableStringMap
ConnectTo
Context
Per-request context object [...]
Controller
Base class for Jaguar controllers
DefaultErrorWriter
Delete
Annotation to declare a method as request handler method that processes DELETE requests.
DeleteJson
Annotation to declare a method as request handler method that processes DELETE requests with JSON response.
ErrorWriter
Error writer interface [...]
ExceptionWithResponse
FormField<T>
Abstract class for fields on multipart/form-data
GenController
Annotates a class that it is an API class that contains route handlers
Get
Annotation to declare a method as request handler method that processes GET requests.
GetHtml
Annotation to declare a method as request handler method that processes GET requests with HTML response.
GetJson
Annotation to declare a method as request handler method that processes GET requests with JSON response.
GroupBuilder
HttpMethod
An annotation to define a route
Idied<T>
Interface to require that Model must contain an Id
IncludeController
Includes the route handlers into the parent API class
Interceptor<Result>
An interceptor based on Dart class. [...]
Jaguar
The Jaguar server
JaguarHttpHeaders
Class to hold HTTP headers
JaguarMapCoder
Encrypts the Map using encrypter. Signs the Map using signer. The final result is made HTTP friendly by Base64 URL encoding. [...]
JaguarSessionManager
A stateless cookie based session manager. [...]
MapCoder
Codes, encrypts and signs the give Map. [...]
MimeType
identifies the type of content of a message
MimeTypes
A namespace class to expose mime type specific features
Muxable
OptionsMethod
Annotation to declare a method as request handler method that processes OPTIONS requests.
PasswordUser
Interface for a user model with a password
Patch
Annotation to declare a method as request handler method that processes PATCH requests.
PathParams
Class to hold path parameters
Post
Annotation to declare a method as request handler method that processes POST requests.
PostJson
Annotation to declare a method as request handler method that processes POST requests with JSON response.
Put
Annotation to declare a method as request handler method that processes PUT requests.
PutJson
Annotation to declare a method as request handler method that processes PUT requests with JSON response.
QueryParams
Class to hold query parameters
Redirect
Response that redirects to the URI specified by value
Request
Request contains information about HTTP request
Response<ValueType>
HTTP response. A route handler must respond to HTTP requests by producing a Response object. [...]
Route
Helps builds a route handler with its interceptors and exception handlers
SecurityContext
The object containing the certificates to trust when making a secure client connection, and the certificate chain and private key to serve from a secure server. [...]
Session
A per-request object containing session information of the request [...]
SessionIo
Reads and writes session data to Context
SessionIoAuthHeader
Reads and writes session data from authorization header
SessionIoCookie
Reads and writes session data from cookies
SessionIoHeader
Reads and writes session data from cookies
SessionManager
Session manager to parse and write session data
SkipResponse
StreamResponse
Response that writes the stream of bytes provided in value to the response.
StringFormField
String field in the multipart/form-data [...]
TextFileFormField
Text file field in the multipart/form-data
TextFileListFormField
UserEmail
AuthorizationUser that uses email as authenticationId and unique record id as authorizationId
UserFetcher<UserModel extends AuthorizationUser>
Interface to fetch user model by authentication and authorization IDs. [...]
UserUsername
AuthorizationUser that uses username as authenticationId and unique record id as authorizationId
UserUsernameEmail
AuthorizationUser that uses username and email as authenticationId and unique record id as authorizationId

Constants

kDefaultCharset → const String
'utf-8'
kDefaultMimeType → const String
'text/plain'

Functions

cleanupSegments(Iterable<String> segments) Iterable<String>
jsonResponseProcessor(Response resp) → void
ResponseProcessor to encode response value to json and also set mimetype to MimeType.json.
pathToSegments(String path) Iterable<String>
Splits given path to composing segments
stringToBool(String value, [ bool defaultValue ]) bool
stringToDouble(String value, [ double defaultValue ]) double
stringToInt(String value, [ int defaultValue ]) int
stringToNum(String value, [ num defaultValue ]) num
wsHandler({WsHandler handler, FutureOr onConnect(Context ctx, WebSocket ws), WsResultProcessor resultProcessor }) RouteHandler
handler is called on reception of data. The return value from handler is written to the websocket. [...]

Typedefs

ExceptionHandler(Context ctx, dynamic exception, StackTrace trace) FutureOr
A function that shall be called when an exception occurs when processing a route. [...]
ResponseProcessor(Response response) → void
Function that modifies response
RouteHandler<RespType>(Context context) FutureOr<RespType>
Prototype for Route handler. A route handler is a function that shall be invoked when a HTTP request with matching path is received. [...]
RouteInterceptor<Result>(Context ctx) FutureOr<Result>
Prototype of route interceptor. A router interceptor is a function that runs before or after the route handler.
WsHandler(dynamic data) FutureOr
WsHandlerWithWs(dynamic data, [ WebSocket socket ]) FutureOr
Function prototype of a websocket handler [...]
WsResultProcessor(dynamic response) String