Documentation
¶
Index ¶
- type Config
- type Plugin
- func (p *Plugin) Config() any
- func (p *Plugin) Handler(next http.Handler) http.Handler
- func (p *Plugin) Init() error
- func (p *Plugin) PostInit() error
- func (p *Plugin) RunRequestPhase(w http.ResponseWriter, r *http.Request) base.RequestPhaseResult
- func (p *Plugin) SetPublicAPIRegistry(registry *Registry)
- type Registry
- func (r *Registry) Checkpoint() RegistryCheckpoint
- func (r *Registry) ClaimOwner(owner string, identity string) error
- func (r *Registry) Lookup(method string, uri string) http.Handler
- func (r *Registry) Register(method string, uri string, handler http.Handler)
- func (r *Registry) Rollback(checkpoint RegistryCheckpoint)
- type RegistryCheckpoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct {
base.BasePlugin
// contains filtered or unexported fields
}
func (*Plugin) RunRequestPhase ¶
func (p *Plugin) RunRequestPhase(w http.ResponseWriter, r *http.Request) base.RequestPhaseResult
RunRequestPhase owns the local public-api gateway response. The gateway is an APISIX response even when a registered handler produces the body.
func (*Plugin) SetPublicAPIRegistry ¶
SetPublicAPIRegistry injects the registry owned by the route generation before PostInit registers any public endpoint.
type Registry ¶
Registry owns the public APIs for one route generation. A registry must be captured by every public-api handler in that generation so route rebuilds cannot change an already-published handler's dispatch table.
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) Checkpoint ¶
func (r *Registry) Checkpoint() RegistryCheckpoint
Checkpoint returns a consistent snapshot of the registry's handlers and owner claims. Handler values are immutable references; only the maps are copied so a rollback cannot retain later registrations.
func (*Registry) ClaimOwner ¶
ClaimOwner rejects conflicting registrations from instances that own the same generation-level public APIs. Repeating an identical identity is safe.
func (*Registry) Rollback ¶
func (r *Registry) Rollback(checkpoint RegistryCheckpoint)
Rollback restores a previously captured registry checkpoint.
type RegistryCheckpoint ¶
type RegistryCheckpoint struct {
// contains filtered or unexported fields
}
RegistryCheckpoint captures a registry generation's mutable public API state so a route build can be rolled back without affecting other routes.