config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	APIConfig: APIConfig{
		ListenAddr: "127.0.0.1:8888",
		SigningKey: "",
	},
	DaemonConfig: DaemonConfig{},
	DatabaseConfig: DatabaseConfig{
		Driver: "sqlite",
		DSN:    "test.db",
	},
}

DefaultConfig is the OpenDyDNSD default configuration

Functions

func Save

func Save(config Config, path string) error

Save configuration in file located at path

Types

type APIConfig

type APIConfig struct {
	ListenAddr   string
	SigningKey   string
	CertCacheDir string
	Hostname     string
	AutoTLS      bool
	TokenTTL     time.Duration
}

APIConfig represent the API configuration

func (APIConfig) SSLEnabled added in v0.3.0

func (ac APIConfig) SSLEnabled() bool

SSLEnabled determinate if SSL (HTTPS) is enabled for the API

func (APIConfig) Valid

func (ac APIConfig) Valid() bool

Valid determinate if config is valid one

type Config

type Config struct {
	APIConfig      APIConfig `toml:"ApiConfig"`
	DaemonConfig   DaemonConfig
	DatabaseConfig DatabaseConfig
}

Config is the global Daemon configuration

func Load

func Load(path string) (Config, error)

Load load configuration from given path

func (Config) Valid

func (c Config) Valid() bool

Valid determinate if config is valid one

type DNSProvisionerConfig

type DNSProvisionerConfig struct {
	Name    string
	Config  map[string]string
	Domains []DomainConfig `toml:"Domain"`
}

DNSProvisionerConfig represent the configuration of a DNS provisioner

type DaemonConfig

type DaemonConfig struct {
	DNSProvisioners []DNSProvisionerConfig `toml:"DnsProvisioner"`
}

DaemonConfig represent the daemon configuration

func (DaemonConfig) Valid

func (dc DaemonConfig) Valid() bool

Valid determinate if config is valid one

type DatabaseConfig

type DatabaseConfig struct {
	Driver string
	DSN    string
}

DatabaseConfig represent the database configuration

func (DatabaseConfig) Valid

func (dc DatabaseConfig) Valid() bool

Valid determinate if config is valid one

type DomainConfig added in v0.3.0

type DomainConfig struct {
	Domain string
	Host   string
}

DomainConfig represent a domain

func (DomainConfig) String added in v0.3.0

func (dc DomainConfig) String() string

Jump to

Keyboard shortcuts

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