types

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAPIPath default api path
	DefaultAPIPath = "/control"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API added in v0.0.3

type API struct {
	Port     int     `json:"port,omitempty" yaml:"port,omitempty" env:"API_PORT"`
	Username string  `json:"username,omitempty" yaml:"username,omitempty" env:"API_USERNAME"`
	Password string  `json:"password,omitempty" yaml:"password,omitempty" env:"API_PASSWORD"`
	DarkMode bool    `json:"darkMode,omitempty" yaml:"darkMode,omitempty" env:"API_DARK_MODE"`
	Metrics  Metrics `json:"metrics,omitempty" yaml:"metrics,omitempty" env:"API_METRICS"`
	TLS      TLS     `json:"tls,omitempty" yaml:"tls,omitempty" env:"API_TLS"`
}

API configuration

func (*API) Mask added in v0.6.1

func (a *API) Mask()

Mask maks username and password

type AdGuardInstance

type AdGuardInstance struct {
	URL                string `json:"url" yaml:"url" env:"URL"`
	WebURL             string `json:"webURL" yaml:"webURL" env:"WEB_URL"`
	APIPath            string `json:"apiPath,omitempty" yaml:"apiPath,omitempty" env:"API_PATH"`
	Username           string `json:"username,omitempty" yaml:"username,omitempty" env:"USERNAME"`
	Password           string `json:"password,omitempty" yaml:"password,omitempty" env:"PASSWORD"`
	Cookie             string `json:"cookie,omitempty" yaml:"cookie,omitempty" env:"COOKIE"`
	InsecureSkipVerify bool   `json:"insecureSkipVerify" yaml:"insecureSkipVerify" env:"INSECURE_SKIP_VERIFY"`
	AutoSetup          bool   `json:"autoSetup" yaml:"autoSetup" env:"AUTO_SETUP"`
	InterfaceName      string `json:"interfaceName,omitempty" yaml:"interfaceName,omitempty" env:"INTERFACE_NAME"`
	DHCPServerEnabled  *bool  `json:"dhcpServerEnabled,omitempty" yaml:"dhcpServerEnabled,omitempty" env:"DHCP_SERVER_ENABLED"`

	Host    string `json:"-" yaml:"-"`
	WebHost string `json:"-" yaml:"-"`
}

AdGuardInstance AdguardHome config instance +k8s:deepcopy-gen=true

func (*AdGuardInstance) DeepCopy added in v0.4.14

func (in *AdGuardInstance) DeepCopy() *AdGuardInstance

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdGuardInstance.

func (*AdGuardInstance) DeepCopyInto added in v0.4.14

func (in *AdGuardInstance) DeepCopyInto(out *AdGuardInstance)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*AdGuardInstance) Init added in v0.5.4

func (i *AdGuardInstance) Init() error

func (*AdGuardInstance) Key

func (i *AdGuardInstance) Key() string

Key AdGuardInstance key

func (*AdGuardInstance) Mask added in v0.4.14

func (i *AdGuardInstance) Mask()

Mask maks username and password

type Config

type Config struct {
	Origin          AdGuardInstance   `json:"origin" yaml:"origin" env:"ORIGIN"`
	Replica         *AdGuardInstance  `json:"replica,omitempty" yaml:"replica,omitempty" env:"REPLICA"`
	Replicas        []AdGuardInstance `json:"replicas,omitempty" yaml:"replicas,omitempty"`
	Cron            string            `json:"cron,omitempty" yaml:"cron,omitempty" env:"CRON"`
	RunOnStart      bool              `json:"runOnStart,omitempty" yaml:"runOnStart,omitempty" env:"RUN_ON_START"`
	PrintConfigOnly bool              `json:"printConfigOnly,omitempty" yaml:"printConfigOnly,omitempty" env:"PRINT_CONFIG_ONLY"`
	ContinueOnError bool              `json:"continueOnError,omitempty" yaml:"continueOnError,omitempty" env:"CONTINUE_ON_ERROR"`
	API             API               `json:"api,omitempty" yaml:"api,omitempty" env:"API"`
	Features        Features          `json:"features,omitempty" yaml:"features,omitempty" env:"FEATURES_"`
}

Config application configuration struct +k8s:deepcopy-gen=true

func (*Config) DeepCopy added in v0.4.14

func (in *Config) DeepCopy() *Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.

func (*Config) DeepCopyInto added in v0.4.14

func (in *Config) DeepCopyInto(out *Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Config) Init added in v0.5.4

func (cfg *Config) Init() error

func (*Config) Log added in v0.4.14

func (cfg *Config) Log(l *zap.SugaredLogger)

Log the current config

func (*Config) UniqueReplicas

func (cfg *Config) UniqueReplicas() []AdGuardInstance

UniqueReplicas get unique replication instances

type DHCP added in v0.3.2

type DHCP struct {
	ServerConfig bool `json:"serverConfig" yaml:"serverConfig" env:"FEATURES_DHCP_SERVER_CONFIG"`
	StaticLeases bool `json:"staticLeases" yaml:"staticLeases" env:"FEATURES_DHCP_STATIC_LEASES"`
}

DHCP features

type DNS added in v0.3.2

type DNS struct {
	AccessLists  bool `json:"accessLists" yaml:"accessLists" env:"FEATURES_DNS_ACCESS_LISTS"`
	ServerConfig bool `json:"serverConfig" yaml:"serverConfig" env:"FEATURES_DNS_SERVER_CONFIG"`
	Rewrites     bool `json:"rewrites" yaml:"rewrites" env:"FEATURES_DNS_REWRITES"`
}

DNS features

type Features added in v0.3.2

type Features struct {
	DNS             DNS  `json:"dns" yaml:"dns"`
	DHCP            DHCP `json:"dhcp" yaml:"dhcp"`
	GeneralSettings bool `json:"generalSettings" yaml:"generalSettings" env:"FEATURES_GENERAL_SETTINGS"`
	QueryLogConfig  bool `json:"queryLogConfig" yaml:"queryLogConfig" env:"FEATURES_QUERY_LOG_CONFIG"`
	StatsConfig     bool `json:"statsConfig" yaml:"statsConfig" env:"FEATURES_STATS_CONFIG"`
	ClientSettings  bool `json:"clientSettings" yaml:"clientSettings" env:"FEATURES_CLIENT_SETTINGS"`
	Services        bool `json:"services" yaml:"services" env:"FEATURES_SERVICES"`
	Filters         bool `json:"filters" yaml:"filters" env:"FEATURES_FILTERS"`
}

Features feature flags

func NewFeatures added in v0.6.1

func NewFeatures(enabled bool) Features

func (*Features) LogDisabled added in v0.3.2

func (f *Features) LogDisabled(l *zap.SugaredLogger)

LogDisabled log all disabled features

type InstallConfig added in v0.2.0

type InstallConfig struct {
	Web      InstallPort `json:"web"`
	DNS      InstallPort `json:"dns"`
	Username string      `json:"username"`
	Password string      `json:"password"`
}

InstallConfig AdguardHome install config

type InstallPort added in v0.2.0

type InstallPort struct {
	IP         string `json:"ip"`
	Port       int    `json:"port"`
	Status     string `json:"status"`
	CanAutofix bool   `json:"can_autofix"`
}

InstallPort AdguardHome install config port

type Metrics added in v0.6.6

type Metrics struct {
	Enabled        bool          `json:"enabled,omitempty" yaml:"enabled,omitempty" env:"API_METRICS_ENABLED"`
	ScrapeInterval time.Duration `json:"scrapeInterval,omitempty" yaml:"scrapeInterval,omitempty" env:"API_METRICS_SCRAPE_INTERVAL"`
	QueryLogLimit  int           `json:"queryLogLimit,omitempty" yaml:"queryLogLimit,omitempty" env:"API_METRICS_QUERY_LOG_LIMIT"`
}

Metrics configuration

type Protection added in v0.0.4

type Protection struct {
	ProtectionEnabled bool `json:"protection_enabled"`
}

Protection API struct

type TLS added in v0.6.9

type TLS struct {
	CertDir  string `json:"certDir,omitempty" yaml:"certDir,omitempty" env:"API_TLS_CERT_DIR"`
	CertName string `json:"certName,omitempty" yaml:"certName,omitempty" env:"API_TLS_CERT_NAME"`
	KeyName  string `json:"keyName,omitempty" yaml:"keyName,omitempty" env:"API_TLS_KEY_NAME"`
}

TLS configuration

func (TLS) Certs added in v0.6.9

func (t TLS) Certs() (cert string, key string)

func (TLS) Enabled added in v0.6.9

func (t TLS) Enabled() bool

Jump to

Keyboard shortcuts

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