Documentation
¶
Overview ¶
Package server wires the okapi HTTP application: routes, middleware, OpenAPI documentation and the embedded SPA.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Service *service.Service
Auth *service.Authenticator
Config *config.Config
Logger *slog.Logger
Version string
// Commit and Date are the rest of the link-time build stamp, surfaced on
// /about so an operator can tell exactly which build is running.
Commit string
Date string
// WebFS holds the built SPA. Nil serves the API only, which is what the
// tests and a headless deployment want.
WebFS fs.FS
// WebRoot is the directory inside WebFS holding index.html.
WebRoot string
}
Options configures a Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server owns the okapi application and everything hanging off it.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dto holds the request and response shapes of the HTTP API.
|
Package dto holds the request and response shapes of the HTTP API. |
|
Package handlers implements the HTTP endpoints.
|
Package handlers implements the HTTP endpoints. |
|
Package middleware holds the HTTP concerns that wrap every request: authentication, role checks and rate limiting.
|
Package middleware holds the HTTP concerns that wrap every request: authentication, role checks and rate limiting. |
Click to show internal directories.
Click to hide internal directories.