config

package
v0.1.1-dev Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 11 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 {
	General GeneralConfig `koanf:"general"`
	DNS     DNSConfig     `koanf:"dns"`
	HTTP    HTTPConfig    `koanf:"http"`
	HTTPS   HTTPSConfig   `koanf:"https"`
}

func Default

func Default() Config

func (Config) Validate

func (c Config) Validate() error

type DNSConfig

type DNSConfig struct {
	Enabled  bool   `koanf:"enabled"`
	Listen   string `koanf:"listen"`
	Network  string `koanf:"network"`
	IPv4     string `koanf:"ipv4"`
	IPv6     string `koanf:"ipv6"`
	Domain   string `koanf:"domain"`
	TXT      string `koanf:"txt"`
	TTL      uint32 `koanf:"ttl"`
	Compress bool   `koanf:"compress"`
}

type GeneralConfig

type GeneralConfig struct {
	ShutdownTimeout time.Duration `koanf:"shutdown_timeout"`
}

type HTTPConfig

type HTTPConfig struct {
	Enabled bool   `koanf:"enabled"`
	Listen  string `koanf:"listen"`
	Status  int    `koanf:"status"`
}

type HTTPSConfig

type HTTPSConfig struct {
	Enabled bool   `koanf:"enabled"`
	Listen  string `koanf:"listen"`
	Status  int    `koanf:"status"`
	Cert    string `koanf:"cert"`
	Key     string `koanf:"key"`
}

type LoadResult

type LoadResult struct {
	Config  Config
	Path    string
	Created bool
}

func LoadOrCreate

func LoadOrCreate(configPath string) (LoadResult, error)

Jump to

Keyboard shortcuts

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