admin

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

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.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the TCP address the server is listening on.

func (*Server) Close

func (s *Server) Close() error

Close shuts down the admin server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL