Documentation ¶
Index ¶
- Constants
- type API
- type AccessList
- type AdGuardInstance
- type Client
- type ClientUpdate
- type Clients
- type Config
- type DHCP
- type DHCPServerConfig
- type DNS
- type DNSConfig
- type EnableConfig
- type Features
- type Filter
- type FilterUpdate
- type FilteringConfig
- type FilteringStatus
- type Filters
- type InstallConfig
- type InstallPort
- type IntervalConfig
- type Lease
- type Leases
- type Protection
- type QueryLogConfig
- type RefreshFilter
- type RewriteEntries
- type RewriteEntry
- type Services
- type Status
- type UserRules
- type V4ServerConfJSON
- type V6ServerConfJSON
Constants ¶
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"` Username string `json:"username,omitempty" yaml:"username,omitempty"` Password string `json:"password,omitempty" yaml:"password,omitempty"` DarkMode bool `json:"darkMode,omitempty" yaml:"darkMode,omitempty"` }
API configuration
type AccessList ¶ added in v0.3.0
type AccessList struct { AllowedClients []string `json:"allowed_clients"` DisallowedClients []string `json:"disallowed_clients"` BlockedHosts []string `json:"blocked_hosts"` }
AccessList access list
func (*AccessList) Equals ¶ added in v0.3.0
func (al *AccessList) Equals(o *AccessList) bool
Equals access list equal check
type AdGuardInstance ¶
type AdGuardInstance struct { URL string `json:"url" yaml:"url"` APIPath string `json:"apiPath,omitempty" yaml:"apiPath,omitempty"` Username string `json:"username,omitempty" yaml:"username,omitempty"` Password string `json:"password,omitempty" yaml:"password,omitempty"` InsecureSkipVerify bool `json:"insecureSkipVerify" yaml:"insecureSkipVerify"` AutoSetup bool `json:"autoSetup" yaml:"autoSetup"` }
AdGuardInstance AdguardHome config instance
type Client ¶
type Client struct { Ids []string `json:"ids,omitempty"` Tags []string `json:"tags,omitempty"` BlockedServices []string `json:"blocked_services,omitempty"` Upstreams []string `json:"upstreams,omitempty"` UseGlobalSettings bool `json:"use_global_settings"` UseGlobalBlockedServices bool `json:"use_global_blocked_services"` Name string `json:"name"` FilteringEnabled bool `json:"filtering_enabled"` ParentalEnabled bool `json:"parental_enabled"` SafesearchEnabled bool `json:"safesearch_enabled"` SafebrowsingEnabled bool `json:"safebrowsing_enabled"` Disallowed bool `json:"disallowed"` DisallowedRule string `json:"disallowed_rule"` }
Client API struct
type ClientUpdate ¶
ClientUpdate API struct
type Clients ¶
type Clients struct { Clients []Client `json:"clients"` AutoClients []struct { IP string `json:"ip"` Name string `json:"name"` Source string `json:"source"` WhoisInfo struct{} `json:"whois_info"` } `json:"auto_clients"` SupportedTags []string `json:"supported_tags"` }
Clients API struct
type Config ¶
type Config struct { Origin AdGuardInstance `json:"origin" yaml:"origin"` Replica AdGuardInstance `json:"replica,omitempty" yaml:"replica,omitempty"` Replicas []AdGuardInstance `json:"replicas,omitempty" yaml:"replicas,omitempty"` Cron string `json:"cron,omitempty" yaml:"cron,omitempty"` RunOnStart bool `json:"runOnStart,omitempty" yaml:"runOnStart,omitempty"` API API `json:"api,omitempty" yaml:"api,omitempty"` Features Features `json:"features,omitempty" yaml:"features,omitempty"` }
Config application configuration struct
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"` StaticLeases bool `json:"staticLeases" yaml:"staticLeases"` }
DHCP features
type DHCPServerConfig ¶ added in v0.3.0
type DHCPServerConfig struct { V4 *V4ServerConfJSON `json:"v4"` V6 *V6ServerConfJSON `json:"v6"` InterfaceName string `json:"interface_name"` Enabled bool `json:"enabled"` Leases Leases `json:"leases,omitempty"` StaticLeases Leases `json:"static_leases,omitempty"` }
DHCPServerConfig dhcp server config
func (*DHCPServerConfig) Equals ¶ added in v0.3.0
func (c *DHCPServerConfig) Equals(o *DHCPServerConfig) bool
Equals dhcp server config equal check
type DNS ¶ added in v0.3.2
type DNS struct { AccessLists bool `json:"accessLists" yaml:"accessLists"` ServerConfig bool `json:"serverConfig" yaml:"serverConfig"` Rewrites bool `json:"rewrites" yaml:"rewrites"` }
DNS features
type DNSConfig ¶ added in v0.3.0
type DNSConfig struct { Upstreams []string `json:"upstream_dns,omitempty"` UpstreamsFile string `json:"upstream_dns_file"` Bootstraps []string `json:"bootstrap_dns,omitempty"` ProtectionEnabled bool `json:"protection_enabled"` RateLimit uint32 `json:"ratelimit"` BlockingMode string `json:"blocking_mode,omitempty"` BlockingIPv4 net.IP `json:"blocking_ipv4,omitempty"` BlockingIPv6 net.IP `json:"blocking_ipv6"` EDNSCSEnabled bool `json:"edns_cs_enabled"` DNSSECEnabled bool `json:"dnssec_enabled"` DisableIPv6 bool `json:"disable_ipv6"` UpstreamMode string `json:"upstream_mode,omitempty"` CacheSize uint32 `json:"cache_size"` CacheMinTTL uint32 `json:"cache_ttl_min"` CacheMaxTTL uint32 `json:"cache_ttl_max"` ResolveClients bool `json:"resolve_clients"` LocalPTRUpstreams []string `json:"local_ptr_upstreams,omitempty"` }
DNSConfig dns config
type EnableConfig ¶ added in v0.0.5
type EnableConfig struct {
Enabled bool `json:"enabled"`
}
EnableConfig API struct
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"` QueryLogConfig bool `json:"queryLogConfig" yaml:"queryLogConfig"` StatsConfig bool `json:"statsConfig" yaml:"statsConfig"` ClientSettings bool `json:"clientSettings" yaml:"clientSettings"` Services bool `json:"services" yaml:"services"` Filters bool `json:"filters" yaml:"filters"` }
Features feature flags
func (*Features) LogDisabled ¶ added in v0.3.2
func (f *Features) LogDisabled(l *zap.SugaredLogger)
LogDisabled log all disabled features
type Filter ¶
type Filter struct { ID int `json:"id"` Enabled bool `json:"enabled"` URL string `json:"url"` // needed for add Name string `json:"name"` // needed for add RulesCount int `json:"rules_count"` Whitelist bool `json:"whitelist"` // needed for add }
Filter API struct
type FilterUpdate ¶ added in v0.1.1
type FilterUpdate struct { URL string `json:"url"` Data Filter `json:"data"` Whitelist bool `json:"whitelist"` }
FilterUpdate API struct
type FilteringConfig ¶
type FilteringConfig struct { EnableConfig IntervalConfig }
FilteringConfig API struct
type FilteringStatus ¶
type FilteringStatus struct { FilteringConfig Filters Filters `json:"filters"` WhitelistFilters Filters `json:"whitelist_filters"` UserRules UserRules `json:"user_rules"` }
FilteringStatus API struct
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 IntervalConfig ¶ added in v0.0.5
type IntervalConfig struct {
Interval float64 `json:"interval"`
}
IntervalConfig API struct
type Lease ¶ added in v0.3.0
type Lease struct { HWAddr string `json:"mac"` IP net.IP `json:"ip"` Hostname string `json:"hostname"` // Lease expiration time // 1: static lease Expiry time.Time `json:"expires"` }
Lease contains the necessary information about a DHCP lease
type Protection ¶ added in v0.0.4
type Protection struct {
ProtectionEnabled bool `json:"protection_enabled"`
}
Protection API struct
type QueryLogConfig ¶ added in v0.0.5
type QueryLogConfig struct { EnableConfig IntervalConfig AnonymizeClientIP bool `json:"anonymize_client_ip"` }
QueryLogConfig API struct
func (*QueryLogConfig) Equals ¶ added in v0.0.5
func (qlc *QueryLogConfig) Equals(o *QueryLogConfig) bool
Equals QueryLogConfig equal check
type RefreshFilter ¶
type RefreshFilter struct {
Whitelist bool `json:"whitelist"`
}
RefreshFilter API struct
type RewriteEntries ¶
type RewriteEntries []RewriteEntry
RewriteEntries list of RewriteEntry
func (*RewriteEntries) Merge ¶
func (rwe *RewriteEntries) Merge(other *RewriteEntries) (RewriteEntries, RewriteEntries, RewriteEntries)
Merge RewriteEntries
type RewriteEntry ¶
RewriteEntry API struct
type Status ¶
type Status struct { Protection DNSAddresses []string `json:"dns_addresses"` DNSPort int `json:"dns_port"` HTTPPort int `json:"http_port"` DhcpAvailable bool `json:"dhcp_available"` Running bool `json:"running"` Version string `json:"version"` Language string `json:"language"` }
Status API struct