serinus
library
Classes
Adapter <TServer >
The Adapter class is used to create a new adapter.
AdapterContainer
The AdapterContainer class is used to manage adapters in the application.
It allows adding, retrieving, and checking the existence of adapters by their name.
AfterHook
A simple hook that executes a function after the request is handled
Application
The Application class is used to create an application.
ApplicationConfig
The configuration for the application
This is used to configure the application
ArgumentsHost
The base class for all argument hosts.
AugmentedMessage
The AugmentedMessage class is used to augment messages with optional parameters.
BaseContext
The BaseContext class must be used as the base class for all contexts.
BeforeHook
A simple hook that executes a function after the response is sent
BodySchemaValidationPipe
Represents a body schema validation pipe.
BodySizeLimitHook
The BodySizeLimitHook class is used to define a body size limit hook.
ClassMetadataNode
A ClassMetadataNode is a class that represents the metadata of a class in the inspector.
ClassNode
A ClassNode is a class that represents a provider in the inspector.
ClassProvider <T extends Provider >
A provider that substitutes one class for another.
ClassToClassEdgeMetadata
A ClassToClassEdgeMetadata is a class that represents the metadata of an edge between two classes in the inspector.
ClientRateLimiter
The ClientRateLimiter class is used to store the rate limit information.
ClientsModule
Module to register and manage microservice clients.
ComposedModule <T extends Module >
The ComposedModule class is used to define a composed module.
ComposedProvider <T extends Provider >
The ComposedProvider 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 Provider s that will be injected in the provider.
CompositionContext
The CompositionContext class is used to provide dependencies to composed modules and composed providers.
ConsoleLogger
The ConsoleLogger class is used to log messages to the console.
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
CorsHook
The CorsHook class is a hook that adds CORS headers to the response.
CustomProvider <T extends Provider >
A marker interface for custom provider definitions.
DefaultMessagesResolver
The DefaultMessagesResolver class is the default implementation of the MessagesResolver class.
DefaultValuePipe <T >
Represents a default value pipe.
DynamicModule
The DynamicModule class is used to define a dynamic module.
Edge
The Edge class is an abstract class that represents an edge in the inspector.
EdgeMetadata
A EdgeMetadata is a class that represents the metadata of an edge in the inspector.
EventData
The EventData class is used to store the data of an event.
EventPacket
Fire-and-forget event.
ExceptionFilter
An interface for handling exceptions in the application.
ExecutionContext <T extends ArgumentsHost >
The execution context for a request, WebSocket message, SSE message, or RPC message.
Export
Defines an export for a module.
FormData
The class FormData is used to parse multipart/form-data and application/x-www-form-urlencoded
GatewayScope
The GatewayScope class is used to define the scope of a WebSocket gateway.
It contains the WebSocketGateway , the providers, and the hooks.
GlobalPrefix
Global prefix for all routes in the controller.
GraphInspector
The GraphInspector class is used to inspect the modules and their dependencies in the application.
It creates a graph representation of the modules and their dependencies.
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 HooksContainer class is used to manage hooks in the application.
HttpAdapter <TServer , TRequest , TResponse >
The HttpAdapter class is used to create an HTTP server adapter.
HttpArgumentsHost
The base class for response-based argument hosts.
IgnoreVersion
Metadata to ignore versioning for a controller or a route
IncomingMessage
The IncomingMessage interface defines the methods and properties that a request must implement.
It is used to parse the request and provide access to its properties.
InstanceWrapper
Wraps an instance with metadata about its origin and dependencies
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.
Logger
The Logger class is a wrapper around the logging.Logger class.
LoggerService
The LoggerService class is used as a blueprint for the loggers.
MessageContext
Context for a message route, including its handler, providers, hooks, and exception filters.
MessageDeserializer <TOutput >
The MessageDeserializer class is used to define a message deserializer.
MessagePacket
Base message packet abstraction shared by request/event/response.
MessageSerializer <TInput >
The WebSocketContext class is used to define the context of the WebSocket.
MessagesResolver
The MessagesResolver class is used to resolve the message routes of the application.
Metadata <T >
The Metadata class is used to define metadata.
MicroserviceApplication
The MicroserviceApplication class is used to create a new instance of the Application class.
MicroservicesModule
The MicroservicesModule class is used to register the microservices module.
MicroservicesRegistry
The MicroservicesRegistry class is used to register the microservices in the application.
Middleware
The Middleware class is used to define a middleware.
MiddlewareConfiguration
Configuration for middleware in the application.
MiddlewareConsumer
A consumer for middleware configurations.
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.
ModuleMetadataNode
A ModuleMetadataNode is a class that represents the metadata of a module in the inspector.
ModuleNode
A ModuleNode is a class that represents a module in the inspector.
ModulesContainer
A container for all the modules of the application.
ModuleScope
Defines the scope of a module including its providers, controllers, and relationships.
ModuleToModuleEdgeMetadata
A ModuleToModuleEdgeMetadata is a class that represents the metadata of a module to module edge in the inspector.
Node
A Node is a class that represents a node in the tree structure of the inspector.
NoopAdapter
The NoopAdapter class is a no-operation implementation of the HttpAdapter class.
OptionalParameters
The OptionalParameters class is used to define the optional parameters of the logger.
OutgoingMessage <T , THeaders >
The OutgoingMessage class is an abstract class that defines the methods and properties
that an Outgoing message must implement in the Serinus framework.
ParseBoolPipe
Represents a boolean parsing pipe.
ParseDatePipe
Represents a date parsing pipe.
ParseDoublePipe
Represents a double parsing pipe.
ParseIntPipe
Represents an integer parsing pipe.
Pipe
Represents a pipe in the request processing pipeline.
Processable
The Processable class is used to create a processable object.
Provider
The Provider class is used to define a provider.
RateLimiterHook
The RateLimiterHook class is a hook that limits the number of requests a client can make.
RateStorage
The RateStorage class is used by the RateLimiterHook to store the rate limiters.
Redirect
The Redirect class is used to create the redirect response.
ReqResHandler <T , B >
Shortcut for a request-response handler. It takes a RequestContext and returns a Response.
Request
The class Request is used to create a request object.
RequestContext <TBody >
A context that exposes the current request information with a strongly typed body.
RequestHook
A simple hook that executes a function when the request is received
RequestPacket
Request expecting a response.
ResponseContext
The ResponseContext class is an utility class that provides a context for the response.
It contains properties and methods to manage the response, such as status code, headers, content type, cookies, and more.
ResponseHook
A simple hook that executes a function when the response is sent
ResponsePacket
Response to a RequestPacket.
ResponseProperties
The ResponseProperties class is used to create the response properties.
RestRouteHandlerSpec <T , B >
The RestRouteHandlerSpec class is used to define a REST route handler specification.
Route
The Route class is used to define the routes of the application.
RouteHandlerSpec <T >
The RouteHandlerSpec class is used to define a route handler specification.
RouteInfo
Information about a specific route in the application.
RpcArgumentsHost
The base class for RPC-based argument hosts.
RpcContext
Context for an RPC message, either a request or an event.
RpcRoute
Route for RPC style communication over a transporter.
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.
SerializedGraph
The SerializedGraph class is used as a base class for the graph inspector.
It contains the nodes and edges of the graph.
SerinusApplication
The SerinusApplication class is used to create a new instance of the Application class.
SerinusFactory
The SerinusFactory class is used to create a new instance of the SerinusApplication class.
The SerinusHeaders are a helper class to expose the headers in the Serinus Framework.
SerinusHttpAdapter
The SerinusHttpAdapter class is used to create an HTTP server adapter.
It extends the HttpAdapter class.
ServerEvent <T >
The ServerEvent class represents an event that is sent to the server.
It contains the type of the event and the data associated with it.
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
SkipRateLimit
The SkipRateLimit class is used to skip the rate limit for a request.
SseAdapter
The SseAdapter class is used to create a new Server-Sent Events (SSE) adapter.
SseArgumentsHost
The base class for Server-Sent Events-based argument hosts.
SseConnection
Code entirely copied from https://raw.githubusercontent.com/dart-lang/sse/master/lib/src/server/sse_handler.dart
I wanted to use the SseConnection with my implementation of the Sse Handler but it was not possible because the
method _addIncomingMessage is private. So I copied the whole code to be able to use it.
A bi-directional SSE connection between server and browser.
SseContext
The SseContext class is used to store the context of a Server-Sent Event (SSE).
SseEmitter
The SseEmitter is responsible for dispatching SSE events to connected clients from other parts of the application.
SseEmitters
The SSE dispatchers are responsible for dispatching SSE events to connected clients.
SseEventData
Represents the data for a Server-Sent Event (SSE).
SseModule
The SSE module is responsible for managing Server-Sent Events (SSE) connections.
SseRegistry
The SseRegistry class is responsible for managing the Server-Sent Events (SSE) in the application.
SseRouteHandlerSpec
The SseRouteHandlerSpec class is used to define a Server-Sent Event (SSE) route handler specification.
SseScope
The SseScope class is used to define the scope of a Server-Sent Events (SSE) gateway.
It contains the SseRouteSpec, the providers, and the hooks.
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.
TransformPipe <R >
Represents a transformation pipe.
TransportAdapter <TDriver , TOptions extends TransportOptions >
Base class for a transport adapter (e.g. in-memory, Redis, NATS, etc.).
It provides unified APIs for request/response (RPC) and event (pub/sub) semantics.
TransportClient <T extends TransportClientOptions >
Base class for a transport client (e.g. in-memory, Redis, NATS, etc.).
TransportClientOptions
Base class for transport client options.
TransportEvent
An abstract class representing a transport event.
TransportInstance
Wrapper class for a transport adapter instance.
TransportOptions
Base class for transport options.
UpgradedEventData
The UpgradedEventData class contains the data for an upgraded event.
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
ValueProvider <T >
A provider that registers a value directly under a type token.
ValueToken
A token that uniquely identifies a value provider.
VersioningOptions
Options for versioning the API
View
The View class contains all the information needed to render a view by a view engine.
ViewEngine
The abstract class ViewEngine is used to define the methods that a view engine must implement.
WebSocketAdapter
The WebSocketAdapter class is used to create a new WebSocket adapter.
WebSocketContext
The WebSocketContext class is used to create a new web socket context.
WebSocketGateway
The WebSocketGateway class is used to define a WebSocketGateway.
WrappedResponse
The WrappedResponse class is used to wrap the response data.
WsAdapter
The WsAdapter class is used to create a new web socket adapter
WsArgumentsHost
The base class for WebSocket-based argument hosts.
WsModule
The WsModule class is used to create a new instance of the Module class.
Extension Types
InjectionToken
A simple class to represent an injection token.
Constants
kDebugMode
→ const bool
The kDebugMode constants is used to determine if the application is running in a debug mode.
In actuality it is true when kReleaseMode and kProfileMode are false.
kDefaultMaxBodySize
→ const int
The default maximum body size in bytes.
kProfileMode
→ const bool
The kProfileMode constants is used to determine if the application is running in a profile mode.
kReleaseMode
→ const bool
The kReleaseMode constants is used to determine if the application is running in a compiled release mode.
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
object (Map <String , AcanthisType > fields )
→ AcanthisMap
Create a map of fields
string ()
→ AcanthisString
Create a new AcanthisString instance
trace <T > (T toTrace (), {required RequestContext context , required String eventName , String ? traced })
→ T
Traces a function.
traceAsync <T > (Future <T > toTrace (), {required RequestContext context , required String eventName , String ? traced })
→ Future <T >
Traces an asynchronous function.
tuple (List <AcanthisType > elements )
→ AcanthisTuple
Creates a new AcanthisTuple with the given elements.
union <T > (List elements )
→ AcanthisUnion<T >
Factory for union of types / variants.