api

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCIDRs added in v0.4.0

func ValidateCIDRs(cidrs []string) error

ValidateCIDRs checks that all entries are valid CIDR notations or bare IPs. Returns an error listing any unparseable entries, so misconfigurations are caught at startup rather than silently ignored.

Types

type ApiListener

type ApiListener struct {
	// contains filtered or unexported fields
}

func NewApiListener

func NewApiListener(cfg ApiListenerConfig, httpHandler http.Handler) (*ApiListener, error)

func (*ApiListener) Addr

func (l *ApiListener) Addr() string

func (*ApiListener) Start

func (l *ApiListener) Start(ctx context.Context) error

Start begins the HTTP server and listens for shutdown signal Returns an error channel that will receive any startup errors

func (*ApiListener) Stop

func (l *ApiListener) Stop() error

func (*ApiListener) Type

func (l *ApiListener) Type() string

type ApiListenerConfig

type ApiListenerConfig struct {
	Logger               *logger.GatedLogger
	Address              string
	TLSCertFile          string
	TLSKeyFile           string
	TLSClientCAFile      string
	TLSEnabled           bool
	TLSRequireClientCert *bool    // nil = default (true when TLSClientCAFile set)
	TrustedProxies       []string // CIDR ranges for LB cert forwarding
}

Jump to

Keyboard shortcuts

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