Documentation
¶
Index ¶
- func APIAuthMiddleware(apiKey string, allowedRoles []string) func(http.Handler) http.Handler
- func APIKeyMiddleware(apiKey string) func(http.Handler) http.Handler
- func MiddlewareChain() []func(http.Handler) http.Handler
- func OpenAPIHandler() http.HandlerFunc
- func SwaggerHandler() http.HandlerFunc
- type API
- type HealthChecker
- type PluginsEnvelope
- type StateHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIAuthMiddleware ¶ added in v0.7.6
APIAuthMiddleware authorizes requests when either the bearer token matches apiKey or when X-User-Roles contains any role listed in allowedRoles.
func APIKeyMiddleware ¶
APIKeyMiddleware checks the Authorization header for a matching API key. Deprecated: use APIAuthMiddleware for role support.
func OpenAPIHandler ¶
func OpenAPIHandler() http.HandlerFunc
OpenAPIHandler serves the generated OpenAPI schema.
func SwaggerHandler ¶
func SwaggerHandler() http.HandlerFunc
SwaggerHandler serves a minimal Swagger UI.
Types ¶
type API ¶
type API struct {
Timeout time.Duration
Health HealthChecker
StateReg *serverstate.Registry
generated.Unimplemented
}
func (*API) GetApiState ¶
func (a *API) GetApiState(w http.ResponseWriter, r *http.Request)
func (*API) GetApiStateStream ¶
func (a *API) GetApiStateStream(w http.ResponseWriter, r *http.Request)
func (*API) GetHealthz ¶
func (a *API) GetHealthz(w http.ResponseWriter, r *http.Request)
type HealthChecker ¶
type HealthChecker interface {
Healthy() bool
}
type PluginsEnvelope ¶ added in v0.6.5
PluginsEnvelope is the generic, plugin-agnostic state payload.
type StateHandler ¶
type StateHandler struct {
// Aggregated plugin state from serverstate.Registry
State *serverstate.Registry
}
StateHandler serves state snapshots and streams.
func (*StateHandler) GetState ¶
func (h *StateHandler) GetState(w http.ResponseWriter, r *http.Request)
GetState returns a JSON snapshot of metrics.
func (*StateHandler) GetStateStream ¶
func (h *StateHandler) GetStateStream(w http.ResponseWriter, r *http.Request)
GetStateStream streams state snapshots as Server-Sent Events.
Click to show internal directories.
Click to hide internal directories.