Documentation
¶
Overview ¶
Package server provides the HTTP server of a voter: REST API, health endpoints, runtime frontend configuration and the embedded SPA.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FrontendAuthConfig ¶
type FrontendAuthConfig struct {
Mode string `json:"mode"`
// Issuer, ClientID and Scopes are set in oidc mode only (ADR 0027).
Issuer string `json:"issuer,omitempty"`
ClientID string `json:"clientId,omitempty"`
Scopes []string `json:"scopes,omitempty"`
}
FrontendAuthConfig tells the SPA how to authenticate.
type FrontendConfig ¶
type FrontendConfig struct {
// Nodes lists API base URLs; empty means "same origin as the page".
Nodes []string `json:"nodes"`
Auth FrontendAuthConfig `json:"auth"`
}
FrontendConfig is the runtime configuration consumed by the SPA (FA-UI-02).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP server of a voter node.
func (*Server) Run ¶
Run serves HTTP on cfg.HTTPAddr until ctx is cancelled, then shuts down gracefully within cfg.ShutdownTimeout.
func (*Server) WithAPI ¶
WithAPI provides the services behind the REST API. It must be called before Run. The clock of the API (deps.Now) also drives the rate limits (ADR 0020).
func (*Server) WithReadiness ¶
WithReadiness adds a check to /readyz, e.g. the health of the Raft node. It must be called before Run.