config

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadEnvFile added in v0.2.0

func LoadEnvFile(filename string) error

Types

type Config

type Config struct {
	Primary      model.PiHole   `required:"true" envconfig:"PRIMARY"`
	Replicas     []model.PiHole `required:"true" envconfig:"REPLICAS"`
	FullSync     bool           `required:"true" envconfig:"FULL_SYNC"`
	Cron         *string        `envconfig:"CRON"`
	SyncSettings *SyncSettings  `ignored:"true"`
}

func (*Config) Load

func (c *Config) Load() error

func (*Config) String added in v0.2.1

func (c *Config) String() string

type ManualConfig

type ManualConfig struct {
	DNS       bool `default:"false" envconfig:"SYNC_CONFIG_DNS"`
	DHCP      bool `default:"false" envconfig:"SYNC_CONFIG_DHCP"`
	NTP       bool `default:"false" envconfig:"SYNC_CONFIG_NTP"`
	Resolver  bool `default:"false" envconfig:"SYNC_CONFIG_RESOLVER"`
	Database  bool `default:"false" envconfig:"SYNC_CONFIG_DATABASE"`
	Webserver bool `default:"false" ignored:"true"` // ignore for now
	Files     bool `default:"false" ignored:"true"` // ignore for now
	Misc      bool `default:"false" envconfig:"SYNC_CONFIG_MISC"`
	Debug     bool `default:"false" envconfig:"SYNC_CONFIG_DEBUG"`
}

type ManualGravity

type ManualGravity struct {
	DHCPLeases        bool `default:"false" envconfig:"SYNC_GRAVITY_DHCP_LEASES"`
	Group             bool `default:"false" envconfig:"SYNC_GRAVITY_GROUP"`
	Adlist            bool `default:"false" envconfig:"SYNC_GRAVITY_AD_LIST"`
	AdlistByGroup     bool `default:"false" envconfig:"SYNC_GRAVITY_AD_LIST_BY_GROUP"`
	Domainlist        bool `default:"false" envconfig:"SYNC_GRAVITY_DOMAIN_LIST"`
	DomainlistByGroup bool `default:"false" envconfig:"SYNC_GRAVITY_DOMAIN_LIST_BY_GROUP"`
	Client            bool `default:"false" envconfig:"SYNC_GRAVITY_CLIENT"`
	ClientByGroup     bool `default:"false" envconfig:"SYNC_GRAVITY_CLIENT_BY_GROUP"`
}

type SyncSettings

type SyncSettings struct {
	Gravity *ManualGravity `ignored:"true"`
	Config  *ManualConfig  `ignored:"true"`
}

Jump to

Keyboard shortcuts

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