config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 9 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 {
	Tailscale    tsconfig.TailscaleConfig `toml:"tailscale"`
	Redis        RedisConfig              `toml:"redis"`
	Revalidation RevalidationConfig       `toml:"revalidation"`
	Defaults     DefaultsConfig           `toml:"defaults"`
	Metrics      metrics.Config           `toml:"metrics"`
	Listeners    []ListenerConfig         `toml:"listeners"`
}

func Load

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

Load reads and parses a TOML config file, expanding environment variables in string values using ${VAR} syntax.

type DefaultLimitsConfig

type DefaultLimitsConfig struct {
	MaxConnsTotal int `toml:"max_conns_total"`
}

type DefaultsConfig

type DefaultsConfig struct {
	Limits DefaultLimitsConfig `toml:"limits"`
}

type ListenerConfig

type ListenerConfig struct {
	Name                string         `toml:"name"`
	Listen              string         `toml:"listen"`
	Mode                string         `toml:"mode"`
	Backend             string         `toml:"backend"`
	BackendViaTailscale bool           `toml:"backend_via_tailscale"`
	Service             string         `toml:"service"`
	Postgres            *PostgresAdmin `toml:"postgres"`
}

func (*ListenerConfig) ListenPort

func (l *ListenerConfig) ListenPort() (uint16, error)

ListenPort extracts the numeric port from the Listen address (e.g. ":5432" → 5432).

type PostgresAdmin

type PostgresAdmin struct {
	AdminUser     string `toml:"admin_user"`
	AdminPassword string `toml:"admin_password"`
	AdminDatabase string `toml:"admin_database"`
	UserPrefix    string `toml:"user_prefix"`
	UserTTL       string `toml:"user_ttl"`
}

func (*PostgresAdmin) UserTTLDuration

func (p *PostgresAdmin) UserTTLDuration() time.Duration

type RedisConfig

type RedisConfig struct {
	Address   string `toml:"address"`
	Password  string `toml:"password"`
	DB        int    `toml:"db"`
	TLS       bool   `toml:"tls"`
	KeyPrefix string `toml:"key_prefix"`
}

type RevalidationConfig

type RevalidationConfig struct {
	Interval string `toml:"interval"`
}

func (RevalidationConfig) IntervalDuration

func (r RevalidationConfig) IntervalDuration() time.Duration

Jump to

Keyboard shortcuts

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