config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DockerConfigPath = "/etc/tailkitd/integrations/docker.toml"
View Source
const FilesConfigPath = "/etc/tailkitd/integrations/files.toml"
View Source
const MetricsConfigPath = "/etc/tailkitd/integrations/metrics.toml"
View Source
const SystemdConfigPath = "/etc/tailkitd/integrations/systemd.toml"
View Source
const VarsConfigPath = "/etc/tailkitd/integrations/vars.toml"

Variables

This section is empty.

Functions

func LoadFilesConfig

func LoadFilesConfig(ctx context.Context, logger *zap.Logger) (types.FilesConfig, error)

LoadFilesConfig loads and validates files.toml from the default path.

Missing file → Enabled=false, nil error (integration disabled, 503). Present but invalid → non-nil error (startup failure).

write_as resolution is best-effort and never fatal:

  • CAP_SETUID absent → warn, WriteAs.Set=false, writes proceed as daemon user.
  • Username not found → warn, WriteAs.Set=false, writes proceed as daemon user.

Types

type CPUMetricsConfig

type CPUMetricsConfig types.CPUMetricsConfig

CPUMetricsConfig controls GET /integrations/metrics/cpu.

type DiskMetricsConfig

type DiskMetricsConfig types.DiskMetricsConfig

DiskMetricsConfig controls GET /integrations/metrics/disk.

type DockerConfig

type DockerConfig struct {
	Enabled    bool
	Containers DockerSectionConfig `toml:"containers"`
	Images     DockerSectionConfig `toml:"images"`
	Compose    DockerSectionConfig `toml:"compose"`
	Swarm      DockerSectionConfig `toml:"swarm"`
}

DockerConfig is the parsed and validated representation of docker.toml. Enabled is set to true only after a successful load — absent file means the docker integration is disabled (503), not an error.

func LoadDockerConfig

func LoadDockerConfig(ctx context.Context, logger *zap.Logger) (DockerConfig, error)

LoadDockerConfig loads and validates docker.toml from the default path.

Missing file → Enabled=false, nil error (integration disabled, 503). Present but invalid → non-nil error (startup failure).

type DockerSectionConfig

type DockerSectionConfig struct {
	// Enabled gates all operations in this section.
	// If false, all endpoints in the section return 403 regardless of Allow.
	Enabled bool `toml:"enabled"`

	// Allow is the list of permitted operations within this section.
	// Valid values differ per section and are validated at startup.
	// An unknown value causes a fatal config error with the valid set listed.
	Allow []string `toml:"allow"`
}

DockerSectionConfig is the common shape for every docker.toml section. Enabled gates the entire section. Allow is the set of permitted operations within that section — validated at load time against the section's closed set of valid values.

func (DockerSectionConfig) Permits

func (s DockerSectionConfig) Permits(op string) bool

Permits returns true if op is both in the allow list and the section is enabled. Callers use this instead of inspecting Allow directly.

type HostMetricsConfig

type HostMetricsConfig types.HostMetricsConfig

HostMetricsConfig controls GET /integrations/metrics/host.

type JournalConfig

type JournalConfig struct {
	// Enabled gates the per-unit journal endpoint
	// (GET /integrations/systemd/units/{unit}/journal).
	Enabled bool `toml:"enabled"`

	// Priority is the minimum log severity to return.
	// Valid values: emerg, alert, crit, err, warning, notice, info, debug.
	// Defaults to "info" if omitted.
	Priority string `toml:"priority"`

	// Lines is the default number of journal lines returned per request.
	// Must be a positive integer. Defaults to 100 if omitted.
	Lines int `toml:"lines"`

	// SystemJournal permits GET /integrations/systemd/journal (system-wide).
	// Kept as a dedicated bool because it is a distinct endpoint, not an
	// operation variant of the per-unit journal.
	SystemJournal bool `toml:"system_journal"`
}

JournalConfig controls journal retrieval behaviour. It applies to both per-unit journal endpoints and the system-wide journal.

type MemoryMetricsConfig

type MemoryMetricsConfig types.MemoryMetricsConfig

MemoryMetricsConfig controls GET /integrations/metrics/memory.

type MetricsConfig

type MetricsConfig types.MetricsConfig

MetricsConfig is the parsed and validated representation of metrics.toml.

Each sub-section maps to one metrics endpoint group. Sections are independent — enabling disk does not require enabling cpu, and so on.

func LoadMetricsConfig

func LoadMetricsConfig(ctx context.Context, logger *zap.Logger) (MetricsConfig, error)

LoadMetricsConfig loads and validates metrics.toml from the default path.

Missing file → Enabled=false, nil error (integration disabled, 503). Present but invalid → non-nil error (startup failure).

func (MetricsConfig) ProcessLimit

func (c MetricsConfig) ProcessLimit() int

ProcessLimit returns the effective process limit. Safe to call on a zero MetricsConfig — returns the default.

type NetworkMetricsConfig

type NetworkMetricsConfig types.NetworkMetricsConfig

NetworkMetricsConfig controls GET /integrations/metrics/network.

type PathRule

type PathRule types.PathRule

type ProcessMetricsConfig

type ProcessMetricsConfig types.ProcessMetricsConfig

ProcessMetricsConfig controls GET /integrations/metrics/processes.

type ResolvedIdentity added in v0.1.17

type ResolvedIdentity types.ResolvedIdentity

type SystemdConfig

type SystemdConfig types.SystemdConfig

SystemdConfig is the parsed and validated representation of systemd.toml.

func LoadSystemdConfig

func LoadSystemdConfig(ctx context.Context, logger *zap.Logger) (SystemdConfig, error)

LoadSystemdConfig loads and validates systemd.toml from the default path.

Missing file → Enabled=false, nil error (integration disabled, 503). Present but invalid → non-nil error (startup failure).

type UnitConfig

type UnitConfig types.UnitConfig

UnitConfig controls which systemd unit operations are permitted.

type VarScope

type VarScope types.VarScope

type VarsConfig

type VarsConfig types.VarsConfig

VarsConfig is the parsed and validated representation of vars.toml.

func LoadVarsConfig

func LoadVarsConfig(ctx context.Context, logger *zap.Logger) (VarsConfig, error)

LoadVarsConfig loads and validates vars.toml from the default path.

Missing file → Enabled=false, nil error (integration disabled, 503). Present but invalid → non-nil error (startup failure).

Jump to

Keyboard shortcuts

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