serinus library
Classes
- AcanthisParseSchema
-
The AcanthisParseSchema class is used to define the schema of the parsing process using the
Acanthis
library. -
Adapter<
TServer> - The Adapter class is used to create a new adapter.
- Application
- The Application class is used to create an application.
- ApplicationConfig
- The configuration for the application This is used to configure the application
- BaseContext
- The BaseContext class must be used as the base class for all contexts.
- Body
- The class Body is used to create a body for the request.
- BodySizeLimitHook
- The BodySizeLimitHook class is used to define a body size limit hook.
-
ContextualizedMetadata<
T> - ContextualizedMetadata is a metadata that is resolved at runtime.
- Controller
- The Controller class is used to define a controller.
- CookieOptions
- A class to encapsulate the options for a cookie
- DeferredProvider
- The DeferredProvider class is used to define a provider that is initialized asynchronously. The init function is called when the provider is initialized. The inject property contains the types of other Providers that will be injected in the provider.
- EventData
- The ResponseProperties class is used to store the properties of a response.
- FormData
- The class FormData is used to parse multipart/form-data and application/x-www-form-urlencoded
- GlobalPrefix
- Global prefix for all routes in the controller.
- Handler
- The base class for all handlers in the application
- Hook
- The Hook class is used to create hooks that can be used to execute code before and after the request is handled
- Hookable
- The Hookable class is used to create a hookable object.
- HooksContainer
- The hooks container for the application
-
HttpAdapter<
TServer> - The HttpAdapter class is used to create an HTTP server adapter.
- InternalRequest
-
The class Request is used to handle the request
it also contains the
httpRequest
property that contains the HttpRequest object from dart:io - InternalResponse
- The InternalResponse class is a wrapper around the HttpResponse class from dart:io.
-
JsonBody<
T> - The class JsonBody is used to create a json body for the request.
- JsonBodyObject
- The class JsonObject is used to create a json object body for the request.
- JsonList
- The class JsonList is used to create a json list body for the request.
- Logger
-
The Logger class is a wrapper around the
logging.Logger
class. - LoggerService
- The LoggerService is used to bootstrap the logging in the application.
-
MessageDeserializer<
TOutput> - The MessageDeserializer class is used to define a message deserializer.
-
MessageSerializer<
TInput> - The WebSocketContext class is used to define the context of the WebSocket.
-
Metadata<
T> - The Metadata class is used to define metadata.
- Middleware
- The Middleware class is used to define a middleware.
- ModelProvider
- A class that provides methods to convert a model to a Map<String, dynamic> and vice versa
- Module
- The Module class is used to define a module.
- ModuleInjectables
- The ModuleInjectables class is used to create the module injectables.
- ModulesContainer
- A container for all the modules of the application
-
ParseSchema<
MapType, BodyType> - The ParseSchema class is used to define the schema of the parsing process.
- Provider
- The Provider class is used to define a provider.
- Redirect
- The Redirect class is used to create the redirect response.
- Request
- The class Request is used to create a request object.
- RequestContext
- The RequestContext class is used to create the request context.
- ResponseProperties
- The ResponseProperties class is used to create the response properties.
- Route
- The Route class is used to define the routes of the application.
- SecureSession
- A class to manage secure sessions
- SecureSessionHook
- The SecureSessionHook class is used to create a hook that can be used to secure the session of the request.
- SerinusApplication
- The SerinusApplication class is used to create a new instance of the Application class.
- SerinusHttpAdapter
- The SerinusHttpAdapter class is used to create an HTTP server adapter. It extends the HttpAdapter class.
- Session
- The class Session exposes the methods to interact with the session of the request.
- SessionOptions
- A class to encapsulate the options for a session
- SessionValue
- A class to encapsulate a session value
- StreamableResponse
- The StreamableResponse class is used to create a streamable response.
- StreamedResponse
- The StreamedResponse class is used to notify the server that the response is streamed.
- TraceEvent
- Represents a trace event.
- Tracer
- Base class for all tracers.
- UploadedFile
- The class UploadedFile is used to represent a file uploaded by the user It is used to parse the file and store it in a string The string can be accessed by calling the toString method The readAsString method is used to parse the file and store it in the string The stream property is used to get the stream of the file The contentType property is used to get the content type of the file The name property is used to get the name of the file
- VersioningOptions
- Options for versioning the API
- View
- The class View is used to store the view data and the variables that will be used in the view.
- ViewEngine
- The abstract class ViewEngine is used to define the methods that a view engine must implement.
- ViewString
- The class ViewString is used to store the view data and the variables that will be used in the view. It contains the data to be shown as a String.
- WebSocketContext
- The WebSocketContext class is used to create a WebSocket context.
- WebSocketGateway
- The WebSocketGateway class is used to define a WebSocketGateway.
- WsAdapter
- The WsAdapter class is used to create a new web socket adapter
- WsModule
- The WsModule class is used to create a new instance of the Module class.
Enums
- HttpMethod
- HTTP methods
- LogLevel
- The log level of the logger.
- RequestEvent
-
The
ResponseEvent
enum is used to define the different events that can be listened to on a response. - TraceEvents
- Represents a trace event.
- VersioningType
- Enum for versioning type
Mixins
- JsonObject
- Mixin for objects that can be converted to JSON.
- OnAfterHandle
- The OnAfterHandle mixin is used to execute code after the request is handled
- OnApplicationBootstrap
- The mixin OnApplicationBootstrap is used to define the method onApplicationBootstrap.
- OnApplicationInit
- The mixin OnApplicationInit is used to define the method onApplicationInit.
- OnApplicationReady
- The mixin OnApplicationReady is used to define the method onApplicationReady.
- OnApplicationShutdown
- The mixin OnApplicationShutdown is used to define the method onApplicationShutdown.
- OnBeforeHandle
- The OnBeforeHandle mixin is used to execute code before the request is handled
- OnClientConnect
- The OnClientConnect mixin is used to handle the client connections.
- OnClientDisconnect
- The OnClientDisconnect mixin is used to handle the client disconnections.
- OnClientError
- The OnClientError mixin is used to handle the client errors.
- OnRequestResponse
- The OnRequestResponse mixin is used to execute code before and after the request is handled
- OnTransform
- The OnTransform mixin is used to execute code before the request is handled
Extensions
-
AddIfAbsent
on Iterable<
T> - This extension is used to add an element to the list if it is not already present
- ContentTypeExtensions on ContentType
- The extension ContentTypeExtensions is used to add functionalities to the ContentType class.
-
Flatten
on Iterable<
Iterable< T> > - This file contains the extensions for the Iterable class
- HeadersToMap on HttpHeaders
- This extension is used to convert a list of headers to a map
-
SplitTypes
on Iterable<
T> - This extension is used to split a list into two lists based on the type of the elements
- StringMethod on String
-
Extension method to convert a string to a
Method
Constants
- saltLength → const int
- The length of the salt
- serinus → const SerinusFactory
-
The serinus instance is used to create a new instance of the
SerinusFactory
class.
Functions
-
boolean(
) → AcanthisBoolean - Create a boolean validator
-
date(
) → AcanthisDate - Create a new date type
-
number(
) → AcanthisNumber - Create a number type
-
object(
Map< String, AcanthisType> fields) → AcanthisMap -
Create a map of
fields
-
string(
) → AcanthisString - Create a new AcanthisString instance
-
union(
List< AcanthisType> elements) → AcanthisUnion - A class that represents a transformation operation
Typedefs
- ErrorHandler = void Function(dynamic e, StackTrace stackTrace)
- The ErrorHandler type is used to define the error handler.
- LogCallback = void Function(String prefix, LogRecord record, int deltaTime)
- The LogCallback is used to style the logs.
-
NextFunction
= Future<
void> Function([Object? data]) - The NextFunction type is used to define the next function of the middleware.
-
ReqResHandler<
T> = Future< T> Function(RequestContext context) -
Shortcut for a request-response handler. It takes a RequestContext and returns a
Response
. -
RequestCallback
= Future<
void> Function(InternalRequest request, InternalResponse response) - The RequestCallback type is used to define the request callback.
- RouteHandler = ({Type? body, dynamic handler, Route route, ParseSchema? schema})
- Shortcut for a route handler. It takes a Route and a ReqResHandler.
-
WsRequestHandler
= Future<
void> Function(dynamic data, WebSocketContext context) - The WsRequestHandler is used to handle the web socket request
Exceptions / Errors
- BadGatewayException
- The class BadGatewayException is used to throw a bad gateway exception
- BadRequestException
- The class BadRequestException is used to throw a bad request exception
- ConflictException
- The class ConflictException is used to throw a conflict exception
- ForbiddenException
- The class ForbiddenException is used to throw a forbidden exception
- GatewayTimeoutException
- The class GatewayTimeoutException is used to throw a gone exception
- GoneException
- The class GoneException is used to throw a gone exception
- HttpVersionNotSupportedException
- The class HttpVersionNotSupportedException is used to throw an http version notsupported exception
- InitializationError
- The InitializationError should be thrown when something during the initialization of the Serinus Application went wrong not for an error of the library but caused by the user.
- InternalServerErrorException
- The class InternalServerErrorException is used to throw a internal server error exception
- MethodNotAllowedException
- The class MethodNotAllowedException is used to throw a method not allowed exception
- NotAcceptableException
- The class NotAcceptableException is used to throw a not acceptable exception
- NotFoundException
- The class NotFoundException is used to throw a not found exception
- NotImplementedException
- The class NotImplementedException is used to throw a not implemented exception
- PayloadTooLargeException
- The class PayloadTooLargeException is used to throw a payload too large exception
- PreconditionFailedException
- The class PreconditionFailedException is used to throw a precondition failed exception
- RequestTimeoutException
- The class RequestTimeoutException is used to throw a request timeout exception
- SerinusException
- The class SerinusException is used as superclass for all exceptions defined in Serinus
- The class ServiceUnavailableException is used to throw a service unavailable exception
- The class UnauthorizedException is used to throw a unauthorized exception
- UnprocessableEntityException
- The class UnprocessableEntityException is used to throw a unsupported media type exception
- UnsupportedMediaTypeException
- The class UnsupportedMediaTypeException is used to throw a unsupported media type exception