Documentation
¶
Overview ¶
router package implements a http.Handler and the ability to register routes on a gateway
Index ¶
Constants ¶
View Source
const (
ScopeRead = "github.com/mutablelogic/go-server/router:read"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Gateway ¶
type Gateway struct {
Prefix string `json:"prefix,omitempty"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Routes []GatewayRoute `json:"routes,omitempty"`
}
type GatewayRoute ¶
type Plugin ¶
type Plugin struct {
task.Plugin
Prefix_ types.String `json:"path,omitempty"` // Path for serving the router schema, optional
Routes []Route `json:"routes"` // Routes to add to the router, optional (but useless without)
Middleware_ []types.Task `json:"middleware,omitempty"` // Middleware to add to the router for requests, optional
}
Plugin for the router maps prefixes to gateways
func (Plugin) WithPrefix ¶
func (Plugin) WithRoutes ¶
Click to show internal directories.
Click to hide internal directories.