Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
Request() *http.Request
Response() *http.Response
SetRequest(req *http.Request)
SetResponse(resp *http.Response)
}
Context is the gateway's per-request context passed to plugins. It provides access to the current request and the aggregated response.
type Middleware ¶
type Middleware interface {
Name() string
Init(cfg map[string]interface{}) error
Handler(next http.Handler) http.Handler
}
Middleware wraps an HTTP handler and executes within the request lifecycle. Middlewares are applied per-flow in the order they are defined.
type Plugin ¶
type Plugin interface {
Info() PluginInfo
Init(cfg map[string]interface{}) error
Type() PluginType
Execute(ctx Context) error
}
Plugin is the interface that all Aastro plugins must implement. Plugins are loaded as Go shared objects (.so) and must be compiled with the exact same Go version as the gateway binary.
type PluginInfo ¶
PluginInfo contains metadata about a plugin.
type PluginType ¶
type PluginType int
PluginType defines when a plugin executes in the request lifecycle.
const ( // PluginTypeRequest runs before upstream dispatch. Can modify request context. PluginTypeRequest PluginType = iota // PluginTypeResponse runs after aggregation. Can modify response headers and body. PluginTypeResponse PluginType = iota )
func (PluginType) String ¶
func (pt PluginType) String() string
Click to show internal directories.
Click to hide internal directories.