Documentation
¶
Overview ¶
Package web owns target-independent compilation support for trb/web.
Index ¶
Constants ¶
View Source
const ( ModulePath = "trb/web/index" ProjectProvider = "trb.web.routes" )
View Source
const MaxBodyBytes = 1 << 20
MaxBodyBytes is the portable request body limit enforced by every adapter.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manifest ¶
type Manifest struct {
Routes []Route
Middlewares []Middleware
}
func ManifestFrom ¶
func (*Manifest) ExtensionName ¶
type Middleware ¶
type Middleware struct {
Filename string
Directory string
ModulePath string
Handler string
TargetHandler string
Span token.Span
}
func NestedMiddlewares ¶ added in v0.2.3
func NestedMiddlewares(middlewares []Middleware) []Middleware
NestedMiddlewares returns middleware that is scoped below the route root. Root middleware is applied once around the complete dispatcher instead.
func RootMiddlewares ¶ added in v0.2.3
func RootMiddlewares(middlewares []Middleware) []Middleware
RootMiddlewares returns the middleware that applies to every request, including responses produced before or after route matching.
type Route ¶
type Route struct {
Filename string
Directory string
Method string
Path string
ModulePath string
Handler string
TargetHandler string
PathParameters []string
Middlewares []Middleware
Span token.Span
}
func UniquePathRoutes ¶
UniquePathRoutes returns the first route for each path in manifest order. Handlers in one route file share the same path parameters and middleware.
Click to show internal directories.
Click to hide internal directories.