Documentation
¶
Overview ¶
Package admin provides an HTTP administration API for a go-DDS participant (Milestone 10 — Enterprise Services: Administration).
The admin server exposes read-only diagnostic endpoints and a sample injection endpoint for remote testing and operations:
GET /admin/health — participant health (requires HealthProvider) GET /admin/topics — topic metrics (requires TopicMetricsProvider) GET /admin/discovery — discovery metrics (requires DiscoveryMetricsProvider) POST /admin/publish — inject a sample into a topic
Optionally, bearer-token authentication can be enforced by setting Options.APIKey. When set, every request must carry the header:
Authorization: Bearer <key>
The server binds on Options.Addr (default ":7070"). Use "host:0" for an OS-assigned port (useful in tests).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Addr is the TCP address to listen on. Defaults to ":7070".
Addr string
// APIKey, if non-empty, requires every request to carry
// "Authorization: Bearer <APIKey>".
APIKey string
}
Options configures an admin Server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an HTTP admin API server for a DDS participant. It is safe for concurrent use from multiple goroutines.
func New ¶
func New(p dds.Participant, opts Options) (*Server, error)
New creates and starts an admin Server for p. Returns an error if the listen address is unavailable.