admin

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Addr string
	// contains filtered or unexported fields
}

Server exposes administrative endpoints.

func New

func New(addr, token string, cfg *config.Config, data []byte, apply func(config.Config) error, stop func(), path string) *Server

New returns a new admin server.

addr specifies the address the server listens on. cfg provides the initial configuration served at /config; it may be nil. data is the raw form of cfg used when computing the initial ETag. apply is invoked with a new configuration when /load is called. stop is called when /stop is requested. path specifies where to persist configuration updates; if empty, updates are not written to disk.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully stops the server.

func (*Server) Start

func (s *Server) Start() error

Start begins listening for connections.

Jump to

Keyboard shortcuts

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