config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Server    ConfServer
	DB        ConfDB
	Rules     ConfRules
	Policy    ConfPolicy
	GeoIP     ConfGeoIP
	LogLevel  string         `env:"LOG_LEVEL" envDefault:"info"`
	LogFormat logging.Format `env:"LOG_FORMAT" envDefault:"text"` // "json" or "text" (tint)
	LogColor  bool           `env:"LOG_COLOR" envDefault:"true"`  // Enable colored output (only for text format)
}

func Load

func Load() (*Conf, error)

type ConfDB

type ConfDB struct {
	DataDir string `env:"DB_DIR" envDefault:"./data"`
	Dsn     string
}

type ConfGeoIP

type ConfGeoIP struct {
	Enabled bool   `env:"GEOIP_ENABLED"   envDefault:"true"`
	DataDir string `env:"GEOIP_DATA_DIR"  envDefault:"./data/geoip"`
}

ConfGeoIP holds configuration for the GeoIP enrichment feature.

type ConfPolicy

type ConfPolicy struct {
	APISecret string `env:"POLICY_ENGINE_API_SECRET,required,notEmpty"`
}

type ConfRules

type ConfRules struct {
	CheckInterval time.Duration `env:"RULE_CHECK_INTERVAL" envDefault:"1m"`
}

ConfRules holds configuration for background rule/scheduler behaviour.

type ConfServer

type ConfServer struct {
	AdminPassword string     `env:"ADMIN_PASSWORD,required,notEmpty"`
	Port          int        `env:"SERVER_PORT" envDefault:"8080"`
	TrustedProxy  netip.Addr `env:"TRUSTED_PROXY"`
	TZ            string     `env:"TZ" envDefault:"UTC"`
}

Jump to

Keyboard shortcuts

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