Documentation
¶
Index ¶
- Constants
- func Exchange(ctx context.Context, req *dns.Msg, logger log.Logger, ...) (resp *dns.Msg, err error)
- func NewDHCPUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewFallbackUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewHTTPSUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewHostsUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewParallelUpstream(_ context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewQUICUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewQueryTestUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewRandomUpstream(_ context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewTCPUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewTLSUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewUDPUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- func NewUpstream(ctx context.Context, core adapter.Core, logger log.Logger, tag string, ...) (adapter.Upstream, error)
- type DHCPUpstream
- func (u *DHCPUpstream) Close() error
- func (u *DHCPUpstream) Dependencies() []string
- func (u *DHCPUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *DHCPUpstream) Start() error
- func (u *DHCPUpstream) StatisticalData() map[string]any
- func (u *DHCPUpstream) Tag() string
- func (u *DHCPUpstream) Type() string
- type DHCPUpstreamOptions
- type FallbackUpstream
- func (u *FallbackUpstream) Close() error
- func (u *FallbackUpstream) Dependencies() []string
- func (u *FallbackUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *FallbackUpstream) Start() error
- func (u *FallbackUpstream) StatisticalData() map[string]any
- func (u *FallbackUpstream) Tag() string
- func (u *FallbackUpstream) Type() string
- type FallbackUpstreamOptions
- type GenericUpstream
- type HTTPQUICConn
- type HTTPQUICEarlyConn
- type HTTPSUpstream
- func (u *HTTPSUpstream) Close() error
- func (u *HTTPSUpstream) Dependencies() []string
- func (u *HTTPSUpstream) Exchange(ctx context.Context, req *dns.Msg) (*dns.Msg, error)
- func (u *HTTPSUpstream) Start() error
- func (u *HTTPSUpstream) StatisticalData() map[string]any
- func (u *HTTPSUpstream) Tag() string
- func (u *HTTPSUpstream) Type() string
- type HTTPSUpstreamOptions
- type HTTPTCPConn
- type HostsUpstream
- func (u *HostsUpstream) Dependencies() []string
- func (u *HostsUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *HostsUpstream) Start() error
- func (u *HostsUpstream) StatisticalData() map[string]any
- func (u *HostsUpstream) Tag() string
- func (u *HostsUpstream) Type() string
- type HostsUpstreamOptions
- type Options
- type ParallelUpstream
- func (u *ParallelUpstream) Dependencies() []string
- func (u *ParallelUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *ParallelUpstream) Start() error
- func (u *ParallelUpstream) StatisticalData() map[string]any
- func (u *ParallelUpstream) Tag() string
- func (u *ParallelUpstream) Type() string
- type ParallelUpstreamOptions
- type QUICUpstream
- func (u *QUICUpstream) Close() error
- func (u *QUICUpstream) Dependencies() []string
- func (u *QUICUpstream) Exchange(ctx context.Context, req *dns.Msg) (*dns.Msg, error)
- func (u *QUICUpstream) Start() error
- func (u *QUICUpstream) StatisticalData() map[string]any
- func (u *QUICUpstream) Tag() string
- func (u *QUICUpstream) Type() string
- type QUICUpstreamOptions
- type QueryTestUpstream
- func (u *QueryTestUpstream) Close() error
- func (u *QueryTestUpstream) Dependencies() []string
- func (u *QueryTestUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *QueryTestUpstream) Start() error
- func (u *QueryTestUpstream) StatisticalData() map[string]any
- func (u *QueryTestUpstream) Tag() string
- func (u *QueryTestUpstream) Type() string
- type QueryTestUpstreamOptions
- type RandomUpstream
- func (u *RandomUpstream) Dependencies() []string
- func (u *RandomUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *RandomUpstream) Start() error
- func (u *RandomUpstream) StatisticalData() map[string]any
- func (u *RandomUpstream) Tag() string
- func (u *RandomUpstream) Type() string
- type RandomUpstreamOptions
- type TCPUpstream
- func (u *TCPUpstream) Close() error
- func (u *TCPUpstream) Dependencies() []string
- func (u *TCPUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *TCPUpstream) Start() error
- func (u *TCPUpstream) StatisticalData() map[string]any
- func (u *TCPUpstream) Tag() string
- func (u *TCPUpstream) Type() string
- type TCPUpstreamOptions
- type TLSOptions
- type TLSUpstream
- func (u *TLSUpstream) Close() error
- func (u *TLSUpstream) Dependencies() []string
- func (u *TLSUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *TLSUpstream) Start() error
- func (u *TLSUpstream) StatisticalData() map[string]any
- func (u *TLSUpstream) Tag() string
- func (u *TLSUpstream) Type() string
- type TLSUpstreamOptions
- type UDPUpstream
- func (u *UDPUpstream) Close() error
- func (u *UDPUpstream) Dependencies() []string
- func (u *UDPUpstream) Exchange(ctx context.Context, req *dns.Msg) (resp *dns.Msg, err error)
- func (u *UDPUpstream) Start() error
- func (u *UDPUpstream) StatisticalData() map[string]any
- func (u *UDPUpstream) Tag() string
- func (u *UDPUpstream) Type() string
- type UDPUpstreamOptions
Constants ¶
View Source
const ( DefaultConnectTimeout = 30 * time.Second DefaultIdleTimeout = 60 * time.Second DefaultQueryTimeout = 15 * time.Second )
View Source
const ( DHCPUpstreamType = "dhcp" DHCPDefaultRequestTimeout = 5 * time.Second DHCPDefaultCheckInterval = 10 * time.Minute )
View Source
const ( DefaultFallbackDomain = "www.example.com" DefaultFallbackInterval = 10 * time.Minute )
View Source
const ( DefaultHTTPSPath = "/dns-query" DefaultHTTPSUserAgent = "cdns" )
View Source
const ( DefaultQueryTestDomain = "www.example.com" DefaultQueryTestInterval = 10 * time.Minute DefaultQueryTestTolerance = 3 * time.Millisecond )
View Source
const DefaultRetry = 3
View Source
const DefaultUDPBufferSize = 4096
View Source
const FallbackUpstreamType = "fallback"
View Source
const HTTPSUpstreamType = "https"
View Source
const HostsUpstreamType = "hosts"
View Source
const ParallelUpstreamType = "parallel"
View Source
const QUICUpstreamType = "quic"
View Source
const QueryTestUpstreamType = "querytest"
View Source
const RandomUpstreamType = "random"
View Source
const TCPUpstreamType = "tcp"
View Source
const TLSUpstreamType = "tls"
View Source
const UDPUpstreamType = "udp"
Variables ¶
This section is empty.
Functions ¶
func NewDHCPUpstream ¶
func NewFallbackUpstream ¶
func NewHTTPSUpstream ¶
func NewHostsUpstream ¶
func NewParallelUpstream ¶
func NewQUICUpstream ¶
func NewQueryTestUpstream ¶
func NewRandomUpstream ¶
func NewTCPUpstream ¶
func NewTLSUpstream ¶
func NewUDPUpstream ¶
Types ¶
type DHCPUpstream ¶
type DHCPUpstream struct {
// contains filtered or unexported fields
}
func (*DHCPUpstream) Close ¶
func (u *DHCPUpstream) Close() error
func (*DHCPUpstream) Dependencies ¶
func (u *DHCPUpstream) Dependencies() []string
func (*DHCPUpstream) Start ¶
func (u *DHCPUpstream) Start() error
func (*DHCPUpstream) StatisticalData ¶
func (u *DHCPUpstream) StatisticalData() map[string]any
func (*DHCPUpstream) Tag ¶
func (u *DHCPUpstream) Tag() string
func (*DHCPUpstream) Type ¶
func (u *DHCPUpstream) Type() string
type DHCPUpstreamOptions ¶
type DHCPUpstreamOptions struct { Interface string `yaml:"interface"` UseIPv6 bool `yaml:"use-ipv6,omitempty"` CheckInterval utils.Duration `yaml:"check-interval,omitempty"` ConnectTimeout utils.Duration `yaml:"connect-timeout,omitempty"` IdleTimeout utils.Duration `yaml:"idle-timeout,omitempty"` EDNS0 bool `yaml:"edns0,omitempty"` DisableFallbackTCP bool `yaml:"disable-fallback-tcp,omitempty"` EnablePipeline bool `yaml:"enable-pipeline,omitempty"` }
type FallbackUpstream ¶
type FallbackUpstream struct {
// contains filtered or unexported fields
}
func (*FallbackUpstream) Close ¶
func (u *FallbackUpstream) Close() error
func (*FallbackUpstream) Dependencies ¶
func (u *FallbackUpstream) Dependencies() []string
func (*FallbackUpstream) Start ¶
func (u *FallbackUpstream) Start() error
func (*FallbackUpstream) StatisticalData ¶
func (u *FallbackUpstream) StatisticalData() map[string]any
func (*FallbackUpstream) Tag ¶
func (u *FallbackUpstream) Tag() string
func (*FallbackUpstream) Type ¶
func (u *FallbackUpstream) Type() string
type FallbackUpstreamOptions ¶
type GenericUpstream ¶
func (*GenericUpstream) Close ¶
func (g *GenericUpstream) Close() error
func (*GenericUpstream) Start ¶
func (g *GenericUpstream) Start() error
type HTTPQUICConn ¶
type HTTPQUICConn struct { quic.Connection // contains filtered or unexported fields }
func (*HTTPQUICConn) CloseWithError ¶
func (c *HTTPQUICConn) CloseWithError(code quic.ApplicationErrorCode, reason string) error
type HTTPQUICEarlyConn ¶
type HTTPQUICEarlyConn struct { quic.EarlyConnection // contains filtered or unexported fields }
func (*HTTPQUICEarlyConn) CloseWithError ¶
func (c *HTTPQUICEarlyConn) CloseWithError(code quic.ApplicationErrorCode, reason string) error
func (*HTTPQUICEarlyConn) NextConnection ¶
func (c *HTTPQUICEarlyConn) NextConnection() quic.Connection
type HTTPSUpstream ¶
type HTTPSUpstream struct {
// contains filtered or unexported fields
}
func (*HTTPSUpstream) Close ¶
func (u *HTTPSUpstream) Close() error
func (*HTTPSUpstream) Dependencies ¶
func (u *HTTPSUpstream) Dependencies() []string
func (*HTTPSUpstream) Start ¶
func (u *HTTPSUpstream) Start() error
func (*HTTPSUpstream) StatisticalData ¶
func (u *HTTPSUpstream) StatisticalData() map[string]any
func (*HTTPSUpstream) Tag ¶
func (u *HTTPSUpstream) Tag() string
func (*HTTPSUpstream) Type ¶
func (u *HTTPSUpstream) Type() string
type HTTPSUpstreamOptions ¶
type HTTPSUpstreamOptions struct { Address string `yaml:"address"` ConnectTimeout utils.Duration `yaml:"connect-timeout,omitempty"` IdleTimeout utils.Duration `yaml:"idle-timeout,omitempty"` TLSOptions TLSOptions `yaml:",inline,omitempty"` UseHTTP3 bool `yaml:"use-http3,omitempty"` UsePost bool `yaml:"use-post,omitempty"` Path string `yaml:"path,omitempty"` Headers map[string]string `yaml:"headers,omitempty"` BootstrapOptions *bootstrap.Options `yaml:"bootstrap,omitempty"` DialerOptions network.Options `yaml:",inline,omitempty"` }
type HTTPTCPConn ¶
func (*HTTPTCPConn) Close ¶
func (c *HTTPTCPConn) Close() error
type HostsUpstream ¶
type HostsUpstream struct {
// contains filtered or unexported fields
}
func (*HostsUpstream) Dependencies ¶
func (u *HostsUpstream) Dependencies() []string
func (*HostsUpstream) Start ¶
func (u *HostsUpstream) Start() error
func (*HostsUpstream) StatisticalData ¶
func (u *HostsUpstream) StatisticalData() map[string]any
func (*HostsUpstream) Tag ¶
func (u *HostsUpstream) Tag() string
func (*HostsUpstream) Type ¶
func (u *HostsUpstream) Type() string
type HostsUpstreamOptions ¶
type Options ¶
type Options struct { Tag string Type string QueryTimeout time.Duration UDPOptions *UDPUpstreamOptions TCPOptions *TCPUpstreamOptions TLSOptions *TLSUpstreamOptions HTTPSOptions *HTTPSUpstreamOptions QUICOptions *QUICUpstreamOptions HostsOptions *HostsUpstreamOptions DHCPOptions *DHCPUpstreamOptions RandomOptions *RandomUpstreamOptions ParallelOptions *ParallelUpstreamOptions QueryTestOptions *QueryTestUpstreamOptions FallbackOptions *FallbackUpstreamOptions }
func (*Options) UnmarshalYAML ¶
type ParallelUpstream ¶
type ParallelUpstream struct {
// contains filtered or unexported fields
}
func (*ParallelUpstream) Dependencies ¶
func (u *ParallelUpstream) Dependencies() []string
func (*ParallelUpstream) Start ¶
func (u *ParallelUpstream) Start() error
func (*ParallelUpstream) StatisticalData ¶
func (u *ParallelUpstream) StatisticalData() map[string]any
func (*ParallelUpstream) Tag ¶
func (u *ParallelUpstream) Tag() string
func (*ParallelUpstream) Type ¶
func (u *ParallelUpstream) Type() string
type ParallelUpstreamOptions ¶
type ParallelUpstreamOptions struct {
Upstreams []string `yaml:"upstreams"`
}
type QUICUpstream ¶
type QUICUpstream struct {
// contains filtered or unexported fields
}
func (*QUICUpstream) Close ¶
func (u *QUICUpstream) Close() error
func (*QUICUpstream) Dependencies ¶
func (u *QUICUpstream) Dependencies() []string
func (*QUICUpstream) Start ¶
func (u *QUICUpstream) Start() error
func (*QUICUpstream) StatisticalData ¶
func (u *QUICUpstream) StatisticalData() map[string]any
func (*QUICUpstream) Tag ¶
func (u *QUICUpstream) Tag() string
func (*QUICUpstream) Type ¶
func (u *QUICUpstream) Type() string
type QUICUpstreamOptions ¶
type QUICUpstreamOptions struct { Address string `yaml:"address"` ConnectTimeout utils.Duration `yaml:"connect-timeout,omitempty"` IdleTimeout utils.Duration `yaml:"idle-timeout,omitempty"` TLSOptions TLSOptions `yaml:",inline,omitempty"` BootstrapOptions *bootstrap.Options `yaml:"bootstrap,omitempty"` DialerOptions network.Options `yaml:",inline,omitempty"` }
type QueryTestUpstream ¶
type QueryTestUpstream struct {
// contains filtered or unexported fields
}
func (*QueryTestUpstream) Close ¶
func (u *QueryTestUpstream) Close() error
func (*QueryTestUpstream) Dependencies ¶
func (u *QueryTestUpstream) Dependencies() []string
func (*QueryTestUpstream) Start ¶
func (u *QueryTestUpstream) Start() error
func (*QueryTestUpstream) StatisticalData ¶
func (u *QueryTestUpstream) StatisticalData() map[string]any
func (*QueryTestUpstream) Tag ¶
func (u *QueryTestUpstream) Tag() string
func (*QueryTestUpstream) Type ¶
func (u *QueryTestUpstream) Type() string
type RandomUpstream ¶
type RandomUpstream struct {
// contains filtered or unexported fields
}
func (*RandomUpstream) Dependencies ¶
func (u *RandomUpstream) Dependencies() []string
func (*RandomUpstream) Start ¶
func (u *RandomUpstream) Start() error
func (*RandomUpstream) StatisticalData ¶
func (u *RandomUpstream) StatisticalData() map[string]any
func (*RandomUpstream) Tag ¶
func (u *RandomUpstream) Tag() string
func (*RandomUpstream) Type ¶
func (u *RandomUpstream) Type() string
type RandomUpstreamOptions ¶
type RandomUpstreamOptions struct {
Upstreams []string `yaml:"upstreams"`
}
type TCPUpstream ¶
type TCPUpstream struct {
// contains filtered or unexported fields
}
func (*TCPUpstream) Close ¶
func (u *TCPUpstream) Close() error
func (*TCPUpstream) Dependencies ¶
func (u *TCPUpstream) Dependencies() []string
func (*TCPUpstream) Start ¶
func (u *TCPUpstream) Start() error
func (*TCPUpstream) StatisticalData ¶
func (u *TCPUpstream) StatisticalData() map[string]any
func (*TCPUpstream) Tag ¶
func (u *TCPUpstream) Tag() string
func (*TCPUpstream) Type ¶
func (u *TCPUpstream) Type() string
type TCPUpstreamOptions ¶
type TCPUpstreamOptions struct { Address string `yaml:"address"` ConnectTimeout utils.Duration `yaml:"connect-timeout,omitempty"` IdleTimeout utils.Duration `yaml:"idle-timeout,omitempty"` EnablePipeline bool `yaml:"enable-pipeline,omitempty"` BootstrapOptions *bootstrap.Options `yaml:"bootstrap,omitempty"` DialerOptions network.Options `yaml:",inline,omitempty"` }
type TLSOptions ¶
type TLSOptions struct { Servername string `yaml:"servername,omitempty"` Insecure bool `yaml:"insecure,omitempty"` ServerCAFile utils.Listable[string] `yaml:"server-ca-file,omitempty"` ClientCertFile string `yaml:"client-cert-file,omitempty"` ClientKeyFile string `yaml:"client-key-file,omitempty"` }
type TLSUpstream ¶
type TLSUpstream struct {
// contains filtered or unexported fields
}
func (*TLSUpstream) Close ¶
func (u *TLSUpstream) Close() error
func (*TLSUpstream) Dependencies ¶
func (u *TLSUpstream) Dependencies() []string
func (*TLSUpstream) Start ¶
func (u *TLSUpstream) Start() error
func (*TLSUpstream) StatisticalData ¶
func (u *TLSUpstream) StatisticalData() map[string]any
func (*TLSUpstream) Tag ¶
func (u *TLSUpstream) Tag() string
func (*TLSUpstream) Type ¶
func (u *TLSUpstream) Type() string
type TLSUpstreamOptions ¶
type TLSUpstreamOptions struct { Address string `yaml:"address"` ConnectTimeout utils.Duration `yaml:"connect-timeout,omitempty"` IdleTimeout utils.Duration `yaml:"idle-timeout,omitempty"` EnablePipeline bool `yaml:"enable-pipeline,omitempty"` TLSOptions TLSOptions `yaml:",inline,omitempty"` BootstrapOptions *bootstrap.Options `yaml:"bootstrap,omitempty"` DialerOptions network.Options `yaml:",inline,omitempty"` }
type UDPUpstream ¶
type UDPUpstream struct {
// contains filtered or unexported fields
}
func (*UDPUpstream) Close ¶
func (u *UDPUpstream) Close() error
func (*UDPUpstream) Dependencies ¶
func (u *UDPUpstream) Dependencies() []string
func (*UDPUpstream) Start ¶
func (u *UDPUpstream) Start() error
func (*UDPUpstream) StatisticalData ¶
func (u *UDPUpstream) StatisticalData() map[string]any
func (*UDPUpstream) Tag ¶
func (u *UDPUpstream) Tag() string
func (*UDPUpstream) Type ¶
func (u *UDPUpstream) Type() string
type UDPUpstreamOptions ¶
type UDPUpstreamOptions struct { Address string `yaml:"address"` ConnectTimeout utils.Duration `yaml:"connect-timeout,omitempty"` IdleTimeout utils.Duration `yaml:"idle-timeout,omitempty"` EDNS0 bool `yaml:"edns0,omitempty"` DisableFallbackTCP bool `yaml:"disable-fallback-tcp,omitempty"` EnablePipeline bool `yaml:"enable-pipeline,omitempty"` BootstrapOptions *bootstrap.Options `yaml:"bootstrap,omitempty"` DialerOptions network.Options `yaml:",inline,omitempty"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.