Documentation
¶
Index ¶
- Constants
- func LoadFilesConfig(ctx context.Context, logger *zap.Logger) (types.FilesConfig, error)
- type CPUMetricsConfig
- type DiskMetricsConfig
- type DockerConfig
- type DockerSectionConfig
- type HostMetricsConfig
- type JournalConfig
- type MemoryMetricsConfig
- type MetricsConfig
- type NetworkMetricsConfig
- type PathRule
- type PortMetricsConfig
- type ProcessMetricsConfig
- type ResolvedIdentity
- type SystemdConfig
- type UnitConfig
- type VarScope
- type VarsConfig
Constants ¶
const DockerConfigPath = "/etc/tailkitd/integrations/docker.toml"
const FilesConfigPath = "/etc/tailkitd/integrations/files.toml"
const MetricsConfigPath = "/etc/tailkitd/integrations/metrics.toml"
const SystemdConfigPath = "/etc/tailkitd/integrations/systemd.toml"
const VarsConfigPath = "/etc/tailkitd/integrations/vars.toml"
Variables ¶
This section is empty.
Functions ¶
func LoadFilesConfig ¶
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 struct {
Enabled bool `json:"enabled" toml:"enabled"`
}
CPUMetricsConfig controls GET /integrations/metrics/cpu.
type DiskMetricsConfig ¶
type DiskMetricsConfig struct {
Enabled bool `json:"enabled" toml:"enabled"`
Paths []string `json:"paths" toml:"paths"`
}
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 ¶
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 struct {
Enabled bool `json:"enabled" toml:"enabled"`
}
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 struct {
Enabled bool `json:"enabled" toml:"enabled"`
}
MemoryMetricsConfig controls GET /integrations/metrics/memory.
type MetricsConfig ¶
type MetricsConfig struct {
Enabled bool `json:"enabled"`
Host HostMetricsConfig `json:"host" toml:"host"`
CPU CPUMetricsConfig `json:"cpu" toml:"cpu"`
Memory MemoryMetricsConfig `json:"memory" toml:"memory"`
Disk DiskMetricsConfig `json:"disk" toml:"disk"`
Network NetworkMetricsConfig `json:"network" toml:"network"`
Processes ProcessMetricsConfig `json:"processes" toml:"processes"`
Ports PortMetricsConfig `json:"ports" toml:"ports"`
}
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 ¶
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 struct {
Enabled bool `json:"enabled" toml:"enabled"`
Interfaces []string `json:"interfaces" toml:"interfaces"`
}
NetworkMetricsConfig controls GET /integrations/metrics/network.
type PortMetricsConfig ¶ added in v0.3.5
type PortMetricsConfig struct {
Enabled bool `json:"enabled" toml:"enabled"`
}
PortMetricsConfig controls the TCP listen port metrics endpoints.
type ProcessMetricsConfig ¶
type ProcessMetricsConfig struct {
Enabled bool `json:"enabled" toml:"enabled"`
Limit *int `json:"limit,omitempty" toml:"limit"`
}
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 ¶
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 VarsConfig ¶
type VarsConfig types.VarsConfig
VarsConfig is the parsed and validated representation of vars.toml.
func LoadVarsConfig ¶
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).