Help us shape the future of Go! Take the 2026 Go Developer Survey

daemon

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, c Config, logger *slog.Logger) error

func RunOnListener

func RunOnListener(ctx context.Context, c Config, logger *slog.Logger, listener net.Listener) error

RunOnListener uses a host-supplied listener and closes it on return, including startup failure. Dependencies remain owned by the service composition.

func Serve

func Serve(ctx context.Context, listener net.Listener, tlsConfig *tls.Config, handler http.Handler, wrap func(http.Handler) http.Handler, probe func(context.Context) map[string]bool, timeout, grace time.Duration, logger *slog.Logger) error

Serve owns the supplied listener until shutdown. The caller owns dependencies and closes them after Serve returns. Probe never returns sensitive diagnostics.

Types

type Config

type Config struct {
	AttestationIdentity *runtimeconfig.AttestationIdentity  `json:"attestation_identity,omitempty"`
	Gateways            []mtlsidentity.GatewayBinding       `json:"gateways,omitempty"`
	Telemetry           *runtimeconfig.Telemetry            `json:"telemetry,omitempty"`
	ContextArchive      *ContextArchivePolicy               `json:"context_archive,omitempty"`
	AcceptTraceContext  bool                                `json:"accept_trace_context,omitempty"`
	OpenFGATraceContext bool                                `json:"openfga_trace_context,omitempty"`
	Extraction          *runtimeconfig.ExtractionScheduling `json:"extraction,omitempty"`
	Retrieval           []runtimeconfig.LexicalRoute        `json:"retrieval"`
	OperationsScope     string                              `json:"operations_scope"`
	Listen              string                              `json:"listen"`
	TLSCertificate      string                              `json:"tls_certificate"`
	TLSKey              string                              `json:"tls_key"`
	ClientCA            string                              `json:"client_ca"`
	Identities          []mtlsidentity.Binding              `json:"identities"`
	OpenFGAURL          string                              `json:"openfga_url"`
	OpenFGAStore        string                              `json:"openfga_store"`
	OpenFGAModel        string                              `json:"openfga_model"`
	ReadinessScope      string                              `json:"readiness_scope"`
	AuditKeyID          string                              `json:"audit_key_id"`
	MaxConnections      int32                               `json:"max_connections"`
	MaxConcurrent       int                                 `json:"max_concurrent"`
	MaxRequestBytes     int                                 `json:"max_request_bytes"`
	MaxResponseBytes    int                                 `json:"max_response_bytes"`
	RPCTimeoutSeconds   int                                 `json:"rpc_timeout_seconds"`
	ShutdownSeconds     int                                 `json:"shutdown_seconds"`
}

func LoadConfig

func LoadConfig(path string) (Config, error)

func (Config) Validate

func (c Config) Validate() error

type ContextArchivePolicy

type ContextArchivePolicy struct {
	Stream              string `json:"stream"`
	MaxPendingRevisions int64  `json:"max_pending_revisions"`
}

Config contains deployment settings, never credentials. Secrets are supplied through environment variables by the host's secret manager.

Jump to

Keyboard shortcuts

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