Documentation
¶
Index ¶
- Constants
- func ConcurrentLookup(ctx context.Context, dst Destination, questions []dns.Question, ...) ([]*dns.Msg, error)
- type ClassicClient
- type ClassicClientOpts
- type Client
- func LoadClient(config *ClientConfig) (Client, error)
- func NewClassicClient(config *ClientConfig, opts ClassicClientOpts) (Client, error)
- func NewDNSCryptClient(config *ClientConfig, opts DNSCryptClientOpts) (Client, error)
- func NewDOHClient(config *ClientConfig) (Client, error)
- func NewDOQClient(config *ClientConfig) (Client, error)
- type ClientConfig
- type DNSCryptClient
- type DNSCryptClientOpts
- type DOHClient
- type DOQClient
- type Destination
- type Option
- func WithClientType(clientType string) Option
- func WithDebugLogger() Option
- func WithInsecureSkipVerify(insecureSkipVerify bool) Option
- func WithLogger(logger *slog.Logger) Option
- func WithTimeout(timeout time.Duration) Option
- func WithUseIPv4(useIPv4 bool) Option
- func WithUseIPv6(useIPv6 bool) Option
- func WithUseTCPFallback(useTCPFallback bool) Option
- func WithUseUDPFallback(useUDPFallback bool) Option
- type QueryFlags
- type QueryFunc
Constants ¶
const ( DefaultClientType = "udp" DefaultTimeout = 2 // in seconds DefaultNdots = 0 DefaultIPv4 = false DefaultIPv6 = false DefaultInsecureSkipVerify = true DefaultUseTCPFallback = true DefaultUseUDPFallback = true )
Default values
Variables ¶
This section is empty.
Functions ¶
func ConcurrentLookup ¶
func ConcurrentLookup(ctx context.Context, dst Destination, questions []dns.Question, flags QueryFlags, queryFunc QueryFunc, logger *slog.Logger) ([]*dns.Msg, error)
ConcurrentLookup performs concurrent DNS lookups
Types ¶
type ClassicClient ¶
type ClassicClient struct {
// contains filtered or unexported fields
}
ClassicClient represents the config options for setting up a Client.
func (*ClassicClient) Lookup ¶
func (c *ClassicClient) Lookup(ctx context.Context, dst Destination, questions []dns.Question, flags QueryFlags) ([]*dns.Msg, error)
Lookup implements the Client interface
type ClassicClientOpts ¶
ClassicClientOpts holds options for setting up a Classic client.
type Client ¶
type Client interface {
Lookup(ctx context.Context, dst Destination, questions []dns.Question, flags QueryFlags) ([]*dns.Msg, error)
// contains filtered or unexported methods
}
Client implements the configuration for a DNS Client. In contrast to doggo, a Client does not specify the endpoint
func LoadClient ¶
func LoadClient(config *ClientConfig) (Client, error)
LoadClient loads the correct Client based on the configuration.
func NewClassicClient ¶
func NewClassicClient(config *ClientConfig, opts ClassicClientOpts) (Client, error)
NewClassicClient accepts a list of nameservers and configures a DNS client.
func NewDNSCryptClient ¶
func NewDNSCryptClient(config *ClientConfig, opts DNSCryptClientOpts) (Client, error)
NewDNSCryptClient accepts a list of nameservers and configures a DNS client.
func NewDOHClient ¶
func NewDOHClient(config *ClientConfig) (Client, error)
NewDOHClient returns a DOHClient
func NewDOQClient ¶
func NewDOQClient(config *ClientConfig) (Client, error)
NewDOQClient accepts a nameserver address and configures a DOQ based client.
type ClientConfig ¶
type ClientConfig struct {
// contains filtered or unexported fields
}
ClientConfig represent a set of common options to configure a Client.
func NewClientConfig ¶
func NewClientConfig(options ...Option) *ClientConfig
Returns a new ClientConfig
func (*ClientConfig) String ¶
func (c *ClientConfig) String() string
String returns a string representation of the ClientConfig
type DNSCryptClient ¶
type DNSCryptClient struct {
// contains filtered or unexported fields
}
DNSCryptClient represents the config options for setting up a Client.
func (*DNSCryptClient) Lookup ¶
func (c *DNSCryptClient) Lookup(ctx context.Context, dst Destination, questions []dns.Question, flags QueryFlags) ([]*dns.Msg, error)
Lookup implements the Client interface
type DNSCryptClientOpts ¶
type DNSCryptClientOpts struct {
UseTCP bool
}
DNSCryptClientOpts holds options for setting up a DNSCrypt client.
type DOHClient ¶
type DOHClient struct {
// contains filtered or unexported fields
}
DOHClient represents the config options for setting up a DOH based client.
type DOQClient ¶
type DOQClient struct {
// contains filtered or unexported fields
}
DOQClient represents the config options for setting up a DOQ based client.
type Destination ¶
Destination specifies the endpoint
type Option ¶
type Option func(*ClientConfig)
ClientConfig options
func WithClientType ¶
func WithInsecureSkipVerify ¶
func WithTimeout ¶
func WithUseIPv4 ¶
func WithUseIPv6 ¶
func WithUseTCPFallback ¶
func WithUseUDPFallback ¶
type QueryFlags ¶
type QueryFlags struct {
AA bool // Authoritative Answer
AD bool // Authenticated Data
CD bool // Checking Disabled
RD bool // Recursion Desired
Z bool // Reserved for future use
DO bool // DNSSEC OK
// EDNS0 options
NSID bool // Request Name Server Identifier
Cookie bool // Request DNS Cookie
Padding bool // Request EDNS padding for privacy
EDE bool // Request Extended DNS Errors
ECS string // EDNS Client Subnet (e.g., "192.0.2.0/24" or "2001:db8::/32")
}
QueryFlags represents the various DNS query flags