winter library

Classes

AbstractWinterRouter
BaseFilter
Body<T>
BuildContext
Cascade
A helper that calls several handlers in sequence and returns the first acceptable response.
CastList<T>
Annotation para obtener el tipo T de una lista y hacerle el parser
CastMap<K, V>
Annotation para obtener el tipo T de un map y hacerle el parser
ConstraintValidatorContext
ConstrainViolation
Class that represent a fail validation (Details and examples in docs)
DefaultHttpStatusCode
Default implementation of {@link HttpStatusCode}.
DefaultOnInvalidUrl
DefaultOnLoadedRoutes
DeleteRoute
DependencyInjection
ExceptionHandler
Filter
FilterChain
FilterConfig
FormData
A Multipart subpart with a parsed name and filename values read from its content-disposition header.
FromJsonParser
Annotation para personalizar el parsea a un objeto a un json
FunctionAsFilter
GetRoute
GlobalFilter
HeadRoute
HRoute
HRouter
HttpHeaders
HttpMethod
Injectable
InjectableProcessor
Injected
JsonProperty
LineScanner
A subclass of StringScanner that tracks line and column information.
LineScannerState
A class representing the state of a LineScanner.
LogsFilter
MediaType
Multipart
An entry in a multipart request.
MultiRouter
NamingStrategies
NotBlank
NotEmpty
NotNull
ObjectMapper
ObjectMapperImpl
OptionsRoute
PackageScanner
ParentRoute
PatchRoute
PathParam
NOTE: path-param dont support optional type
Pipeline
A helper that makes it easy to compose a set of Middleware and a Handler.
PlainBodyWrapper<T>
wrapper around plain body to be able to use generic type
PostRoute
ProcessedComponent
PropertyParser
Annotation con ambas funciones from-json y to-json
PutRoute
QueryParam
QueryRoute
RateLimiter
RateLimiterFilter
RawComponent
Request
An HTTP request to be processed by a Shelf application.
RequestEntity
RequestRoute
Response
The response returned by a Handler.
ResponseEntity
Route
RouterConfig
ScanComponent
Base annotation for top level annotations, if ANYTHING is not annotated with this, it's not processed All top level annotations SHOULD extends this if they wanna be processed
Server
An adapter with a concrete URL.
ServerConfig
ServerHandler
A connected pair of a Server and a Handler.
ServeRouter
Example: ServeRouter((request) => ResponseEntity.ok(body: 'Hello world!!!')) This will handle all request and always return a 200:Hello world!!!
SimpleExceptionHandler
Size
SpanScanner
A subclass of LineScanner that exposes matched ranges as source map FileSpans.
StringScanner
A class that scans through a string using Patterns.
ToJsonParser
Annotation para personalizar el parsea a un json de un objeto
Valid
ValidationService
Default class to define the validation
ValidationServiceImpl
Winter
WinterDeserializable
WinterRouter
WinterSerializer

Enums

ComponentType
HttpStatus
ProcessedAs
Series
Enumeration of HTTP status series.

Mixins

HttpStatusCode
Represents an HTTP response status code. Implemented by {@link HttpStatus}, but defined as an interface to allow for values not in that enumeration.
Validatable
mixin to implement in every class where the validation want to be done it by hand
ValidMessage

Extension Types

FormDataRequest
A multipart request containing form data.
MultipartRequest
A multipart request.

Extensions

GloballyValidatable on Object
extension to make every object validatable Just call: someObject.validate()
MiddlewareExtensions on Middleware
Extensions on Middleware to aid in composing Middleware and Handlers.
MultipartFromRequest on Request
Extensions that call MultipartRequest.of and FormDataRequest.of as an extension on Request.

Constants

basic → const String
bearer → const String
Authorization pair for bearer & basic
defaultServerPort → const int

Properties

addChunkedEncoding Middleware
Middleware that adds chunked transfer coding to a responses if none of the following conditions are true:
final
di DependencyInjection
Dependency Injection: easy access to the current dependency injection instance
no setter
eh ExceptionHandler
Exception Handler: easy access to the current exception handler instance
no setter
nonToken RegExp
A character that is not a valid HTTP token.
final
om ObjectMapper
Dependency Injection: easy access to the current object mapper instance
no setter
token RegExp
An HTTP token.
final
vs ValidationService
Validation Service: easy access to the current validation service instance
no setter
whitespace RegExp
A regular expression matching any number of _lws productions in a row.
final

Functions

bodyListParser<T>(String body, ObjectMapper om) List<T>
internal parser/caster to list
bodyMapParser<T>(String body, ObjectMapper om) Map<String, T>
internal parser/caster to map
createMiddleware({FutureOr<Response?> requestHandler(Request)?, FutureOr<Response> responseHandler(Response)?, FutureOr<Response> errorHandler(Object error, StackTrace)?}) Middleware
Creates a Middleware using the provided functions.
defaultLogErrorResponse(Exception exception) → void
defaultLogRateLimiter(dynamic request, dynamic requestId) → void
defaultLogRequest(RequestEntity request) → void
defaultLogResponse(ResponseEntity response) → void
expectQuotedString(StringScanner scanner, {String name = 'quoted string'}) String
Parses a double quoted string, and returns its contents.
isValidUri(String path) bool
listCaster<T>(List list) List<T>
funcion por defecto para hacer el parser de una List
logRequests({void logger(String message, bool isError)?}) Middleware
Middleware which prints the time of the request, the elapsed time for the inner handlers, the response's status code and the request URI.
mapCaster<K, V>(Map map) Map<K, V>
funcion por defecto para hacer el parser de una List
notBlank(dynamic property, ConstraintValidatorContext cvc) bool
notEmpty(dynamic property, ConstraintValidatorContext cvc) bool
notNull(dynamic property, ConstraintValidatorContext cvc) bool
parseList<T>(StringScanner scanner, T parseElement()) List<T>
Parses a list of elements, as in 1#element in the HTTP spec.
plainBodyParser<T>(String body, ObjectMapper om) PlainBodyWrapper<T>
internal parser/caster to plain Object (Wrapped to allow using generics)
processBodyAnnotation(List<ParamExtractor> positionalArgumentsFunctions, Map<Symbol, ParamExtractor> namedArgumentsFunctions, ParameterMirror singleParam, ObjectMapper om) bool
processHeaderAnnotation(List<ParamExtractor> positionalArgumentsFunctions, Map<Symbol, ParamExtractor> namedArgumentsFunctions, ParameterMirror singleParam) bool
processPathParamAnnotation(List<ParamExtractor> positionalArgumentsFunctions, Map<Symbol, ParamExtractor> namedArgumentsFunctions, ParameterMirror singleParam) bool
processQueryParamAnnotation(List<ParamExtractor> positionalArgumentsFunctions, Map<Symbol, ParamExtractor> namedArgumentsFunctions, ParameterMirror singleParam) bool
size(dynamic property, ConstraintValidatorContext cvc) bool

Typedefs

ExcHandler = FutureOr<ResponseEntity> Function(RequestEntity request, Exception error, StackTrace stackTrac)
ExceptionHandler
FromJsonParserFunction = dynamic Function(dynamic property)
Definicion de funcion para hacer el parseo de un json a un objeto
FunctionFilter = FutureOr<ResponseEntity> Function(RequestEntity request, FilterChain chain)
Handler = FutureOr<Response> Function(Request request)
A function which handles a Request.
ListParserFunction<T> = List<T> Function(List property)
Definicion de funcion para hacer el casteo de: List
MapParserFunction<K, V> = Map<K, V> Function(Map property)
Definicion de funcion para hacer el casteo de: Map
Middleware = Handler Function(Handler innerHandler)
A function which creates a new Handler by wrapping a Handler.
NamingStrategy = String Function(String value)
OnInvalidUrl = void Function(Route failedRoute)
OnLoadedRoutes = void Function(List<Route> allRoutes)
ParamExtractor = dynamic Function(RequestEntity request)
Function used to extract a param, like the body or an header from a request
RequestHandler = FutureOr<ResponseEntity> Function(RequestEntity request)
A function which handles a RequestEntity.
ToJsonParserFunction = dynamic Function(dynamic property)
Definicion de funcion para hacer el parseo de un objeto a un json
ValidationFunction = bool Function(dynamic object, ConstraintValidatorContext cvc)

Exceptions / Errors

ApiException
Base exception
BadRequestException
exception for 400
ConflictException
exception for 409
ForbiddenException
exception for 401
HijackException
An exception used to indicate that a request has been hijacked.
InternalServerErrorException
exception for 500
NotFoundException
exception for 404
PaymentRequiredException
exception for 402
ResponseException
Special exception to break up any current flow and return this instead
StringScannerException
An exception thrown by a StringScanner that failed to parse a string.
UnauthorizedException
exception for 403
UnprocessableEntityException
Validation exception 422
ValidationException