Documentation ¶
Overview ¶
Package dnssvc contains the AdGuard Home DNS service.
TODO(a.garipov): Define, if all methods of a *Service should work with a nil receiver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Addresses are the addresses on which to serve plain DNS queries. Addresses []netip.AddrPort // Upstreams are the DNS upstreams to use. If not set, upstreams are // created using data from BootstrapServers, UpstreamServers, and // UpstreamTimeout. // // TODO(a.garipov): Think of a better scheme. Those other three parameters // are here only to make Config work properly. Upstreams []upstream.Upstream // BootstrapServers are the addresses for bootstrapping the upstream DNS // server addresses. BootstrapServers []string // UpstreamServers are the upstream DNS server addresses to use. UpstreamServers []string // UpstreamTimeout is the timeout for upstream requests. UpstreamTimeout time.Duration }
Config is the AdGuard Home DNS service configuration structure.
TODO(a.garipov): Add timeout for incoming requests.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the AdGuard Home DNS service. A nil *Service is a valid agh.Service that does nothing.
func New ¶
New returns a new properly initialized *Service. If c is nil, svc is a nil *Service that does nothing. The fields of c must not be modified after calling New.
func (*Service) Config ¶
Config returns the current configuration of the web service. Config must not be called simultaneously with Start. If svc was initialized with ":0" addresses, addrs will not return the actual bound ports until Start is finished.
func (*Service) Shutdown ¶
Shutdown implements the agh.Service interface for *Service. svc may be nil.
func (*Service) Start ¶
Start implements the agh.Service interface for *Service. svc may be nil. After Start exits, all DNS servers have tried to start, but there is no guarantee that they did. Errors from the servers are written to the log.