config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Journal JournalConfig `toml:"journal"`
	Schema  SchemaConfig  `toml:"schema"`
	Server  ServerConfig  `toml:"server"`
}

Config holds all loki-lite configuration.

func Load

func Load(path string) (*Config, error)

Load reads a TOML file, substitutes ${VAR:-default} environment variable references, and returns the parsed configuration. If path is empty, returns the default configuration. Missing keys use their default values.

type JournalConfig

type JournalConfig struct {
	// Dir is the path to the journald directory.
	// Default: /var/log/journal
	Dir string `toml:"dir"`
	// Name is an optional journal name prefix (empty = all).
	// Default: ""
	Name string `toml:"name"`
}

JournalConfig holds journal-related configuration.

type SchemaConfig

type SchemaConfig struct {
	// Exclude lists journal fields to exclude from stream labels.
	// Default: [MESSAGE, SYSLOG_TIMESTAMP, _SOURCE_MONOTONIC_TIMESTAMP, _SOURCE_REALTIME_TIMESTAMP]
	Exclude []string `toml:"exclude"`
}

SchemaConfig holds label schema configuration.

type ServerConfig

type ServerConfig struct {
	// Addr is the listen address.
	// Default: :3100
	Addr string `toml:"addr"`
	// PoolMax is the maximum number of pooled journal connections.
	// Default: 10
	PoolMax int `toml:"pool_max"`
}

ServerConfig holds HTTP server configuration.

Jump to

Keyboard shortcuts

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