redstone library

Classes

AnnotatedType<T>
ApplicationMetadata
Provides access for installed routes, interceptors, error handlers and groups that composes an application.
Attr
An annotation to define a request attribute. [...]
Body
An annotation to define a target parameter. [...]
Chain
A chain of handlers. [...]
Credentials
User credentials (HTTP Basic Authentication)
DefaultRoute
An annotation to define a target which must be bound to the URL of its group. [...]
DefaultRouteMetadata
Default route metadata information
DynamicMap<String, V>
A Map that allows the use of the dot notation to access its values [...]
ErrorHandler
An annotation to define error handlers. [...]
ErrorHandlerMetadata
Error handler metadata information
ErrorResponse
An error response. [...]
Group
An annotation to define groups. [...]
GroupMetadata
Group metadata information
HandlerMetadata<T, M>
The base metadata class for handlers
Ignore
Use this annotation to import a library without installing its handlers
Inject
An annotation to define a injectable dependency. [...]
Install
An annotation to include handlers from other libraries
Interceptor
An annotation to define interceptors. [...]
InterceptorMetadata
Interceptor metadata information
LibraryMetadata
Library metadata information
Manager
Allows to programmatically create routes, interceptors, error handlers, parameter providers and response processors. [...]
MockHttpHeaders
MockHttpRequest
MockHttpResponse
MockHttpSession
A mock session, intended to be used with MockRequest. [...]
MockRequest
A class to simulate requests in unit tests. [...]
QueryParam
An annotation to define a target parameter. [...]
Request
The request information and content.
RequestTarget
RequestTargetMetadata
ResponseProcessorMetadata
Route
An annotation to define targets. [...]
RouteMetadata
Route metadata information
RouteWrapperMetadata
ServerMetadata
Metadata of the current application

Constants

BINARY → const BodyType
BodyType.BINARY
CONNECT → const String
'CONNECT'
defaultAddress → const String
'0.0.0.0'
defaultPort → const int
8080
DELETE → const String
'DELETE'
FORM → const BodyType
BodyType.FORM
GET → const String
HTTP methods
'GET'
'HEAD'
JSON → const BodyType
BodyType.JSON
OPTIONS → const String
'OPTIONS'
POST → const String
'POST'
PUT → const String
'PUT'
TEXT → const BodyType
BodyType.TEXT
TRACE → const String
'TRACE'

Properties

chain Chain
Returns the current request chain
read-only
redstoneLogger Logger
final
request Request
Returns the current request
read-only
response Response
Returns the current response
read / write
router → Router
read-only
showErrorPage bool
By default, redstone generates an error page whenever a response with status code less than 200, or greater or equal than 300, is returned. To prevent this behavior, set this flag to false.
read / write

Functions

abort(int statusCode) Future<Response>
Creates a new response for statusCode. If there is an ErrorHandler registered for this status code, it will be invoked.
addModule(Module module) → void
Register a module for dependency injection. [...]
addPlugin(RedstonePlugin plugin) → void
Register a plugin. [...]
addShelfMiddleware(Middleware middleware) → void
Register a Shelf Middleware. [...]
dispatch(MockRequest request) Future<MockHttpResponse>
Dispatch a request. [...]
handleRequest(HttpRequest request) Future
Handle a HttpRequest. [...]
redirect(String url) Response
Creates a new response with an 302 status code.
redstoneSetUp([List<Symbol> libraries, bool logSetUp = true ]) Future
Scan and initialize routes, interceptors and error handlers [...]
redstoneTearDown() → void
Remove all modules, plugins, routes, interceptors and error handlers. [...]
serveRequests(Stream<HttpRequest> requests) Future
Serve a Stream of HttpRequests. [...]
setShelfHandler(Handler handler) → void
Register a Shelf Handler. [...]
setupConsoleLog([Level level = Level.INFO ]) → void
Setup a simple log handler, that output messages to console.
start({String address: defaultAddress, int port: defaultPort, bool autoCompress: false, bool shared: false, bool logSetUp: true, Map<Symbol, dynamic> secureOptions }) Future<HttpServer>
Start the server. [...]

Enums

BodyType
Content types
HandlerType
Handler types

Typedefs

DynamicHandler(Injector injector, Request request) → dynamic
An interceptor or error handler, programmatically created by a plugin.
DynamicRoute(Injector injector, Request request) → dynamic
A route programmatically created by a plugin.
ParamProvider(dynamic metadata, Type paramType, String handlerName, String paramName, Request request, Injector injector) → dynamic
A parameter provider is a function that can create parameters for routes, interceptors and error handlers. [...]
RedstonePlugin(Manager manager) → dynamic
A plugin is a function which can dynamically add new features to an application.
ResponseProcessor(dynamic metadata, String handlerName, Object response, Injector injector) → dynamic
A response processor is a function which can transform values returned by routes.
RouteWrapper(dynamic metadata, Injector injector, Request request, DynamicRoute route) → dynamic
A route wrapper created by a plugin.

Exceptions / Errors

PluginException
SetupException
An SetupException can be thrown during the setUp stage of Redstone