Documentation ¶
Index ¶
- type ADG
- func (c *ADG) ConfigureFiltering(filterConfig FilterConfig) (*FilterConfig, error)
- func (c *ADG) CreateClient(client Client) (*Client, error)
- func (c *ADG) CreateListFilter(filterData AddUrlRequest) (*Filter, bool, error)
- func (c *ADG) CreateRewrite(rewrite RewriteEntry) (*RewriteEntry, error)
- func (c *ADG) DeleteClient(clientDelete ClientDelete) error
- func (c *ADG) DeleteListFilter(filterDelete RemoveUrlRequest) error
- func (c *ADG) DeleteRewrite(domain string) error
- func (c *ADG) GetAccess() (*AccessList, error)
- func (c *ADG) GetAllClients() (*AllClients, error)
- func (c *ADG) GetAllFilters() (*FilterStatus, error)
- func (c *ADG) GetAllRewrites() (*[]RewriteEntry, error)
- func (c *ADG) GetBlockedServices() (*BlockedServicesSchedule, error)
- func (c *ADG) GetBlockedServicesList() (*BlockedServicesAll, error)
- func (c *ADG) GetClient(identifier string) (*Client, error)
- func (c *ADG) GetDhcpInterfaces() (*NetInterfaces, error)
- func (c *ADG) GetDhcpStatus() (*DhcpStatus, error)
- func (c *ADG) GetDnsInfo() (*DNSInfo, error)
- func (c *ADG) GetListFilterById(id int64) (*Filter, bool, error)
- func (c *ADG) GetListFilterByName(listName string) (*Filter, bool, error)
- func (c *ADG) GetParentalStatus() (*bool, error)
- func (c *ADG) GetQueryLogConfig() (*GetQueryLogConfigResponse, error)
- func (c *ADG) GetRewrite(domain string) (*RewriteEntry, error)
- func (c *ADG) GetSafeBrowsingStatus() (*bool, error)
- func (c *ADG) GetSafeSearchConfig() (*SafeSearchConfig, error)
- func (c *ADG) GetStatsConfig() (*GetStatsConfigResponse, error)
- func (c *ADG) GetTlsConfig() (*TlsConfig, error)
- func (c *ADG) GetUserRules() (*[]string, error)
- func (c *ADG) ManageDhcpStaticLease(add bool, dhcpStaticLease DhcpStaticLease) (*DhcpStaticLease, error)
- func (c *ADG) ResetDhcpConfig() error
- func (c *ADG) ResetDhcpStaticLeases() error
- func (c *ADG) SetAccess(accessList AccessList) (*AccessList, error)
- func (c *ADG) SetBlockedServices(blockedServicesSchedule BlockedServicesSchedule) (*BlockedServicesSchedule, error)
- func (c *ADG) SetDhcpConfig(dhcpConfig DhcpConfig) (*DhcpConfig, error)
- func (c *ADG) SetDnsConfig(dnsConfig DNSConfig) (*DNSConfig, error)
- func (c *ADG) SetParentalStatus(status bool) error
- func (c *ADG) SetQueryLogConfig(queryLogConfig GetQueryLogConfigResponse) (*GetQueryLogConfigResponse, error)
- func (c *ADG) SetSafeBrowsingStatus(status bool) error
- func (c *ADG) SetSafeSearchConfig(safeSearchConfig SafeSearchConfig) (*SafeSearchConfig, error)
- func (c *ADG) SetStatsConfig(statsConfig GetStatsConfigResponse) (*GetStatsConfigResponse, error)
- func (c *ADG) SetTlsConfig(tlsConfig TlsConfig) (*TlsConfig, error)
- func (c *ADG) UpdateClient(clientUpdate ClientUpdate) (*Client, error)
- func (c *ADG) UpdateListFilter(filterUpdate FilterSetUrl) (*Filter, bool, error)
- func (c *ADG) UpdateRewrite(rewrite RewriteEntry) (*RewriteEntry, error)
- func (c *ADG) UpdateUserRules(rules SetRulesRequest) (*[]string, error)
- type AccessList
- type AddUrlRequest
- type AllClients
- type AuthStruct
- type BlockedService
- type BlockedServicesAll
- type BlockedServicesSchedule
- type Client
- type ClientAuto
- type ClientDelete
- type ClientUpdate
- type DNSConfig
- type DNSInfo
- type DayRange
- type DhcpConfig
- type DhcpConfigV4
- type DhcpConfigV6
- type DhcpLease
- type DhcpStaticLease
- type DhcpStatus
- type Enabled
- type Filter
- type FilterConfig
- type FilterSetUrl
- type FilterSetUrlData
- type FilterStatus
- type GetQueryLogConfigResponse
- type GetStatsConfigResponse
- type NetInterface
- type NetInterfaces
- type RemoveUrlRequest
- type RewriteEntry
- type SafeSearchConfig
- type Schedule
- type SetRulesRequest
- type TlsConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ADG ¶
type ADG struct { HostURL string HTTPClient *http.Client Auth AuthStruct }
ADG Client
func NewClient ¶
func NewClient(host, username, password, scheme *string, timeout *int, enableInsecureSkipVerify ...*bool) (*ADG, error)
NewClient
func (*ADG) ConfigureFiltering ¶ added in v0.5.0
func (c *ADG) ConfigureFiltering(filterConfig FilterConfig) (*FilterConfig, error)
ConfigureFiltering - Configure DNS server filtering parameters
func (*ADG) CreateClient ¶
CreateClient - Create a client
func (*ADG) CreateListFilter ¶ added in v0.2.1
func (c *ADG) CreateListFilter(filterData AddUrlRequest) (*Filter, bool, error)
CreateListFilter - Create a list filter, returning the created filter and whether it's a whitelist filter
func (*ADG) CreateRewrite ¶ added in v0.3.0
func (c *ADG) CreateRewrite(rewrite RewriteEntry) (*RewriteEntry, error)
CreateRewrite - Create a DNS rewrite rule
func (*ADG) DeleteClient ¶
func (c *ADG) DeleteClient(clientDelete ClientDelete) error
DeleteClient - Deletes a client
func (*ADG) DeleteListFilter ¶ added in v0.2.1
func (c *ADG) DeleteListFilter(filterDelete RemoveUrlRequest) error
DeleteListFilter - Deletes a list filter
func (*ADG) DeleteRewrite ¶ added in v0.3.0
DeleteRewrite - Delete a DNS rewrite rule based on the domain
func (*ADG) GetAccess ¶ added in v0.4.0
func (c *ADG) GetAccess() (*AccessList, error)
GetAccess - Returns the current access list
func (*ADG) GetAllClients ¶ added in v0.8.0
func (c *ADG) GetAllClients() (*AllClients, error)
GetAllClients - Returns all clients
func (*ADG) GetAllFilters ¶ added in v0.2.1
func (c *ADG) GetAllFilters() (*FilterStatus, error)
GetAllFilter - Returns all filters
func (*ADG) GetAllRewrites ¶ added in v0.3.0
func (c *ADG) GetAllRewrites() (*[]RewriteEntry, error)
GetAllRewrites - Returns all DNS rewrite rules
func (*ADG) GetBlockedServices ¶ added in v0.5.0
func (c *ADG) GetBlockedServices() (*BlockedServicesSchedule, error)
GetBlockedServices - Returns the services that are blocked globally
func (*ADG) GetBlockedServicesList ¶ added in v0.5.0
func (c *ADG) GetBlockedServicesList() (*BlockedServicesAll, error)
GetBlockedServicesList - Returns the list of all available services to be blocked
func (*ADG) GetDhcpInterfaces ¶ added in v0.6.0
func (c *ADG) GetDhcpInterfaces() (*NetInterfaces, error)
GetDhcpStatus - Returns the available DHCP interfaces
func (*ADG) GetDhcpStatus ¶ added in v0.6.0
func (c *ADG) GetDhcpStatus() (*DhcpStatus, error)
GetDhcpStatus - Returns the current DHCP status
func (*ADG) GetDnsInfo ¶ added in v0.4.0
GetDnsInfo - Returns the current DNS parameters
func (*ADG) GetListFilterById ¶ added in v0.2.1
GetListFilterById - Returns a list filter based on its name and whether it's a whitelist filter
func (*ADG) GetListFilterByName ¶ added in v0.2.1
GetListFilterByName - Returns a list filter based on its name and whether it's a whitelist filter
func (*ADG) GetParentalStatus ¶ added in v0.5.0
GetParentalStatus - Returns whether parental control is enabled or not
func (*ADG) GetQueryLogConfig ¶ added in v0.5.0
func (c *ADG) GetQueryLogConfig() (*GetQueryLogConfigResponse, error)
GetQueryLogConfig - Returns query log configuration parameters
func (*ADG) GetRewrite ¶ added in v0.3.0
func (c *ADG) GetRewrite(domain string) (*RewriteEntry, error)
GetRewrite - Return a DNS rewrite rule based on the domain
func (*ADG) GetSafeBrowsingStatus ¶ added in v0.5.0
GetSafeBrowsingStatus - Returns whether safe-browsing is enabled or not
func (*ADG) GetSafeSearchConfig ¶ added in v0.5.0
func (c *ADG) GetSafeSearchConfig() (*SafeSearchConfig, error)
GetSafeSearchStatus - Retrieve safe search configuration
func (*ADG) GetStatsConfig ¶ added in v0.5.0
func (c *ADG) GetStatsConfig() (*GetStatsConfigResponse, error)
GetStatsConfig - Returns statistics configuration parameters
func (*ADG) GetTlsConfig ¶ added in v0.6.0
GetTlsConfig - Returns TLS configuration and status
func (*ADG) GetUserRules ¶ added in v0.2.1
GetUserRules - Returns a list of all user rules
func (*ADG) ManageDhcpStaticLease ¶ added in v0.6.0
func (c *ADG) ManageDhcpStaticLease(add bool, dhcpStaticLease DhcpStaticLease) (*DhcpStaticLease, error)
ManageDhcpStaticLease - Add ot remove a DHCP static lease
func (*ADG) ResetDhcpConfig ¶ added in v0.6.0
ResetDhcpConfig - reset all DHCP configuration to defaults
func (*ADG) ResetDhcpStaticLeases ¶ added in v0.6.0
ResetDhcpStaticLeases - reset all DHCP static leases
func (*ADG) SetAccess ¶ added in v0.4.0
func (c *ADG) SetAccess(accessList AccessList) (*AccessList, error)
SetAccess - Sets the access list
func (*ADG) SetBlockedServices ¶ added in v0.5.0
func (c *ADG) SetBlockedServices(blockedServicesSchedule BlockedServicesSchedule) (*BlockedServicesSchedule, error)
UpdateBlockedServices - Update blocked services
func (*ADG) SetDhcpConfig ¶ added in v0.6.0
func (c *ADG) SetDhcpConfig(dhcpConfig DhcpConfig) (*DhcpConfig, error)
SetDhcpConfig - Sets DHCP server configuration
func (*ADG) SetDnsConfig ¶ added in v0.4.0
SetDnsConfig - Sets DNS parameters
func (*ADG) SetParentalStatus ¶ added in v0.5.0
SetParentalStatus - Enable or disable parental controls
func (*ADG) SetQueryLogConfig ¶ added in v0.5.0
func (c *ADG) SetQueryLogConfig(queryLogConfig GetQueryLogConfigResponse) (*GetQueryLogConfigResponse, error)
SetQueryLogConfig - Sets query log configuration parameters
func (*ADG) SetSafeBrowsingStatus ¶ added in v0.5.0
SetSafeBrowsingStatus - Enable or disable safe-browsing
func (*ADG) SetSafeSearchConfig ¶ added in v0.5.0
func (c *ADG) SetSafeSearchConfig(safeSearchConfig SafeSearchConfig) (*SafeSearchConfig, error)
SetSafeSearchConfig - Set safe search configuration
func (*ADG) SetStatsConfig ¶ added in v0.5.0
func (c *ADG) SetStatsConfig(statsConfig GetStatsConfigResponse) (*GetStatsConfigResponse, error)
SetStatsConfig - Sets statistics configuration parameters
func (*ADG) SetTlsConfig ¶ added in v0.6.0
SetTlsConfig - Sets the TLS configuration
func (*ADG) UpdateClient ¶
func (c *ADG) UpdateClient(clientUpdate ClientUpdate) (*Client, error)
UpdateClient - Update a client
func (*ADG) UpdateListFilter ¶ added in v0.2.1
func (c *ADG) UpdateListFilter(filterUpdate FilterSetUrl) (*Filter, bool, error)
UpdateListFilter - Update a list filter, returning the updated filter and whether it's a whitelist filter
func (*ADG) UpdateRewrite ¶ added in v0.3.0
func (c *ADG) UpdateRewrite(rewrite RewriteEntry) (*RewriteEntry, error)
UpdateRewrite - Update a DNS rewrite rule
func (*ADG) UpdateUserRules ¶ added in v0.2.1
func (c *ADG) UpdateUserRules(rules SetRulesRequest) (*[]string, error)
UpdateUserRules - Update user-provided rules, returning the list of all user rules
type AccessList ¶ added in v0.4.0
type AccessList struct { AllowedClients []string `json:"allowed_clients"` DisallowedClients []string `json:"disallowed_clients"` BlockedHosts []string `json:"blocked_hosts"` }
AccessList
type AddUrlRequest ¶ added in v0.2.1
type AddUrlRequest struct { Name string `json:"name"` Url string `json:"url"` Whitelist bool `json:"whitelist"` }
AddUrlRequest
type AllClients ¶
type AllClients struct { Clients []Client `json:"clients"` ClientAuto []ClientAuto `json:"auto_clients"` SupportedTags []string `json:"supported_tags"` }
AllClients
type AuthStruct ¶
AuthStruct
type BlockedService ¶ added in v0.5.0
type BlockedService struct { IconSvg string `json:"icon_svg"` Id string `json:"id"` Name string `json:"name"` Rules []string `json:"rules"` }
BlockedService
type BlockedServicesAll ¶ added in v0.5.0
type BlockedServicesAll struct {
BlockedServices []BlockedService `json:"blocked_services"`
}
BlockedServicesAll
type BlockedServicesSchedule ¶ added in v0.7.0
type BlockedServicesSchedule struct { Schedule Schedule `json:"schedule,omitempty"` Ids []string `json:"ids"` }
BlockedServicesSchedule
type Client ¶
type Client struct { Name string `json:"name"` Ids []string `json:"ids"` UseGlobalSettings bool `json:"use_global_settings"` FilteringEnabled bool `json:"filtering_enabled"` ParentalEnabled bool `json:"parental_enabled"` SafebrowsingEnabled bool `json:"safebrowsing_enabled"` SafesearchEnabled bool `json:"safesearch_enabled"` // deprecated SafeSearch SafeSearchConfig `json:"safe_search"` UseGlobalBlockedServices bool `json:"use_global_blocked_services"` BlockedServicesSchedule Schedule `json:"blocked_services_schedule"` BlockedServices []string `json:"blocked_services"` Upstreams []string `json:"upstreams"` Tags []string `json:"tags"` IgnoreQuerylog bool `json:"ignore_querylog"` IgnoreStatistics bool `json:"ignore_statistics"` UpstreamsCacheEnabled bool `json:"upstreams_cache_enabled"` UpstreamsCacheSize uint `json:"upstreams_cache_size"` }
Client
type ClientAuto ¶
type ClientAuto struct { Name string `json:"name"` Ip string `json:"ip"` Source string `json:"source"` WhoisInfo map[string]string `json:"whois_info"` }
ClientAuto
type ClientUpdate ¶
ClientUpdate
type DNSConfig ¶ added in v0.4.0
type DNSConfig struct { BootstrapDns []string `json:"bootstrap_dns"` UpstreamDns []string `json:"upstream_dns"` FallbackDns []string `json:"fallback_dns"` UpstreamDnsFile string `json:"upstream_dns_file"` ProtectionEnabled bool `json:"protection_enabled"` RateLimit uint `json:"ratelimit"` RateLimitSubnetSubnetLenIpv4 uint `json:"ratelimit_subnet_len_ipv4"` RateLimitSubnetSubnetLenIpv6 uint `json:"ratelimit_subnet_len_ipv6"` RateLimitWhitelist []string `json:"ratelimit_whitelist"` BlockingMode string `json:"blocking_mode"` BlockingIpv4 string `json:"blocking_ipv4"` BlockingIpv6 string `json:"blocking_ipv6"` BlockedResponseTtl uint `json:"blocked_response_ttl"` EDnsCsEnabled bool `json:"edns_cs_enabled"` EDnsCsUseCustom bool `json:"edns_cs_use_custom"` EDnsCsCustomIp string `json:"edns_cs_custom_ip"` DisableIpv6 bool `json:"disable_ipv6"` DnsSecEnabled bool `json:"dnssec_enabled"` CacheSize uint `json:"cache_size"` CacheTtlMin uint `json:"cache_ttl_min"` CacheTtlMax uint `json:"cache_ttl_max"` CacheOptimistic bool `json:"cache_optimistic"` UpstreamMode string `json:"upstream_mode"` UsePrivatePtrResolvers bool `json:"use_private_ptr_resolvers"` ResolveClients bool `json:"resolve_clients"` LocalPtrUpstreams []string `json:"local_ptr_upstreams"` }
DNSConfig
type DNSInfo ¶ added in v0.4.0
type DNSInfo struct { *DNSConfig DefaultLocalPtrUpstreams []string `json:"default_local_ptr_upstreams"` }
DNSInfo
type DhcpConfig ¶ added in v0.6.0
type DhcpConfig struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 DhcpConfigV4 `json:"v4,omitempty"` V6 DhcpConfigV6 `json:"v6,omitempty"` }
DhcpConfig
type DhcpConfigV4 ¶ added in v0.6.0
type DhcpConfigV4 struct { GatewayIp string `json:"gateway_ip,omitempty"` SubnetMask string `json:"subnet_mask,omitempty"` RangeStart string `json:"range_start,omitempty"` RangeEnd string `json:"range_end,omitempty"` LeaseDuration uint64 `json:"lease_duration,omitempty"` }
DhcpConfigV4
type DhcpConfigV6 ¶ added in v0.6.0
type DhcpConfigV6 struct { RangeStart string `json:"range_start,omitempty"` LeaseDuration uint64 `json:"lease_duration,omitempty"` }
DhcpConfigV6
type DhcpLease ¶ added in v0.6.0
type DhcpLease struct { Mac string `json:"mac"` Ip string `json:"ip"` Hostname string `json:"hostname"` Expires string `json:"expires"` }
DhcpLease
type DhcpStaticLease ¶ added in v0.6.0
type DhcpStaticLease struct { Mac string `json:"mac"` Ip string `json:"ip"` Hostname string `json:"hostname"` }
DhcpStaticLease
type DhcpStatus ¶ added in v0.6.0
type DhcpStatus struct { Enabled bool `json:"enabled"` InterfaceName string `json:"interface_name"` V4 DhcpConfigV4 `json:"v4"` V6 DhcpConfigV6 `json:"v6"` Leases []DhcpLease `json:"leases"` StaticLeases []DhcpStaticLease `json:"static_leases"` }
DhcpStatus
type Filter ¶ added in v0.2.1
type Filter struct { Enabled bool `json:"enabled"` Id int64 `json:"id"` LastUpdated string `json:"last_updated"` Name string `json:"name"` RulesCount int32 `json:"rules_count"` Url string `json:"url"` }
Filter
type FilterConfig ¶ added in v0.5.0
FilterConfig
type FilterSetUrl ¶ added in v0.2.1
type FilterSetUrl struct { Data FilterSetUrlData `json:"data"` Url string `json:"url"` Whitelist bool `json:"whitelist"` }
FilterSetUrl
type FilterSetUrlData ¶ added in v0.2.1
type FilterSetUrlData struct { Enabled bool `json:"enabled"` Name string `json:"name"` Url string `json:"url"` }
FilterSetUrlData
type FilterStatus ¶ added in v0.2.1
type FilterStatus struct { Enabled bool `json:"enabled"` Interval uint `json:"interval"` Filters []Filter `json:"filters"` WhitelistFilters []Filter `json:"whitelist_filters"` UserRules []string `json:"user_rules"` }
FilterStatus
type GetQueryLogConfigResponse ¶ added in v0.5.0
type GetQueryLogConfigResponse struct { Enabled bool `json:"enabled"` Interval uint64 `json:"interval"` AnonymizeClientIp bool `json:"anonymize_client_ip"` Ignored []string `json:"ignored"` }
GetQueryLogConfigResponse
type GetStatsConfigResponse ¶ added in v0.5.0
type GetStatsConfigResponse struct { Enabled bool `json:"enabled"` Interval uint64 `json:"interval"` Ignored []string `json:"ignored"` }
GetStatsConfigResponse
type NetInterface ¶ added in v0.6.0
type NetInterface struct { Flags string `json:"flags"` HardwareAddress string `json:"hardware_address"` Name string `json:"name"` IpAddresses []string `json:"ip_addresses"` Mtu int `json:"mtu"` }
NetInterface
type RemoveUrlRequest ¶ added in v0.2.1
RemoveUrlRequest
type RewriteEntry ¶ added in v0.3.0
RewriteEntry
type SafeSearchConfig ¶ added in v0.5.0
type SafeSearchConfig struct { Enabled bool `json:"enabled"` Bing bool `json:"bing"` Duckduckgo bool `json:"duckduckgo"` Ecosia bool `json:"ecosia"` Google bool `json:"google"` Pixabay bool `json:"pixabay"` Yandex bool `json:"yandex"` Youtube bool `json:"youtube"` }
SafeSearchConfig
type Schedule ¶ added in v0.7.0
type Schedule struct { TimeZone string `json:"time_zone,omitempty"` Sunday DayRange `json:"sun,omitempty"` Monday DayRange `json:"mon,omitempty"` Tuesday DayRange `json:"tue,omitempty"` Wednesday DayRange `json:"wed,omitempty"` Thursday DayRange `json:"thu,omitempty"` Friday DayRange `json:"fri,omitempty"` Saturday DayRange `json:"sat,omitempty"` }
Schedule
type SetRulesRequest ¶ added in v0.2.1
type SetRulesRequest struct {
Rules []string `json:"rules"`
}
SetRulesRequest
type TlsConfig ¶ added in v0.6.0
type TlsConfig struct { Enabled bool `json:"enabled"` ServerName string `json:"server_name"` ForceHttps bool `json:"force_https"` PortHttps uint16 `json:"port_https"` PortDnsOverTls uint16 `json:"port_dns_over_tls"` PortDnsOverQuic uint16 `json:"port_dns_over_quic"` CertificateChain string `json:"certificate_chain"` PrivateKey string `json:"private_key"` PrivateKeySaved bool `json:"private_key_saved"` CertificatePath string `json:"certificate_path"` PrivateKeyPath string `json:"private_key_path"` ValidCert bool `json:"valid_cert"` ValidChain bool `json:"valid_chain"` Subject string `json:"subject"` Issuer string `json:"issuer"` NotBefore string `json:"not_before"` NotAfter string `json:"not_after"` DnsNames []string `json:"dns_names"` ValidKey bool `json:"valid_key"` KeyType string `json:"key_type"` WarningValidation string `json:"warning_validation"` ValidPair bool `json:"valid_pair"` ServePlainDns bool `json:"serve_plain_dns"` }
TlsConfig