Documentation
¶
Index ¶
- Constants
- func GetUpstreamDNSFromFile(ctx context.Context, filename string) (<-chan UpstreamDNS, error)
- func NewDNSHandler(options ...DNSOption) *dnsHandler
- func Same[T comparable](a, b []T) bool
- type ClientFactory
- type CoreDNSServer
- type DNSClient
- type DNSConfig
- type DNSFailoverForwarder
- type DNSForwarder
- type DNSForwarderConfig
- type DNSForwarderOption
- func WithForwarderAddress(address string) DNSForwarderOption
- func WithForwarderTimeout(timeout time.Duration) DNSForwarderOption
- func WithForwarderZone(zone string) DNSForwarderOption
- func WithResolvconfPath(path string) DNSForwarderOption
- func WithReusePort() DNSForwarderOption
- func WithUpstreams(upstreams []string) DNSForwarderOption
- type DNSOption
- type ForwarderFactory
- type InterfaceProber
- type ManagedForwarder
- type UpstreamDNS
Constants ¶
View Source
const ( ResolvConfPath = "/etc/resolv.conf" SystemdResolvConfPath = "/run/systemd/resolve/resolv.conf" )
Variables ¶
This section is empty.
Functions ¶
func GetUpstreamDNSFromFile ¶
func GetUpstreamDNSFromFile(ctx context.Context, filename string) (<-chan UpstreamDNS, error)
func NewDNSHandler ¶
func NewDNSHandler(options ...DNSOption) *dnsHandler
func Same ¶
func Same[T comparable](a, b []T) bool
Types ¶
type CoreDNSServer ¶
type CoreDNSServer struct {
// contains filtered or unexported fields
}
func (*CoreDNSServer) Serve ¶
func (s *CoreDNSServer) Serve() (func(), error)
type DNSConfig ¶
type DNSConfig struct {
Timeout time.Duration
ClientFactory ClientFactory
}
type DNSFailoverForwarder ¶
type DNSFailoverForwarder struct {
// contains filtered or unexported fields
}
func (*DNSFailoverForwarder) Serve ¶
func (d *DNSFailoverForwarder) Serve() (func(), error)
type DNSForwarder ¶
type DNSForwarder interface {
Serve() (stop func(), err error)
}
func NewCoreDNSServer ¶
func NewCoreDNSServer(ctx context.Context, options ...DNSForwarderOption) (DNSForwarder, error)
func NewDNSFailoverForwarder ¶
func NewDNSFailoverForwarder(ctx context.Context, options ...DNSForwarderOption) (DNSForwarder, error)
type DNSForwarderConfig ¶
type DNSForwarderOption ¶
type DNSForwarderOption func(*DNSForwarderConfig)
func WithForwarderAddress ¶
func WithForwarderAddress(address string) DNSForwarderOption
func WithForwarderTimeout ¶
func WithForwarderTimeout(timeout time.Duration) DNSForwarderOption
func WithForwarderZone ¶
func WithForwarderZone(zone string) DNSForwarderOption
func WithResolvconfPath ¶
func WithResolvconfPath(path string) DNSForwarderOption
func WithReusePort ¶
func WithReusePort() DNSForwarderOption
func WithUpstreams ¶
func WithUpstreams(upstreams []string) DNSForwarderOption
type DNSOption ¶
type DNSOption func(*DNSConfig)
func WithClientFactory ¶
func WithClientFactory(factory ClientFactory) DNSOption
func WithTimeout ¶
type ForwarderFactory ¶
type ForwarderFactory interface {
NewForwarder(ctx context.Context, addr string) (DNSForwarder, error)
}
ForwarderFactory creates a DNS forwarder bound to the given address.
type InterfaceProber ¶
InterfaceProber checks whether the target network interface is present.
type ManagedForwarder ¶
type ManagedForwarder struct {
// contains filtered or unexported fields
}
ManagedForwarder tracks an interface lifecycle and starts/stops a DNS forwarder as the interface appears and disappears.
func NewManagedForwarder ¶
func NewManagedForwarder( parent context.Context, interval time.Duration, prober InterfaceProber, factory ForwarderFactory, ) *ManagedForwarder
func (*ManagedForwarder) Serve ¶
func (m *ManagedForwarder) Serve() (func(), error)
type UpstreamDNS ¶
Click to show internal directories.
Click to hide internal directories.