daemon

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

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

Daemon is the fully-wired daemon. One instance per process.

func New

func New(configPath string, version string, logger *slog.Logger) (*Daemon, error)

New constructs and fully wires a Daemon. Returns an error if any subsystem fails to initialise — no partial startup.

func (*Daemon) Reload

func (d *Daemon) Reload() error

Reload re-reads the config file and applies live-reloadable settings. Settings that require a restart are logged as warnings and skipped.

func (*Daemon) Run

func (d *Daemon) Run(ctx context.Context)

Run starts the proxy and blocks until the context is cancelled or the proxy errors out. SIGHUP triggers a live config reload without stopping the proxy.

func (*Daemon) SetUpstreamTransport

func (d *Daemon) SetUpstreamTransport(rt http.RoundTripper)

SetUpstreamTransport replaces the transport used to forward requests to the upstream origin. Intended for testing only — inject a transport that dials a local httptest.Server so tests don't need real DNS or internet access.

func (*Daemon) Shutdown

func (d *Daemon) Shutdown(ctx context.Context)

Shutdown tears down all subsystems in reverse dependency order. Called after Run returns. The context controls the deadline for services that perform cleanup (puppet, obfuscator).

Jump to

Keyboard shortcuts

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