Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DoHTransport ¶
type DoHTransport struct {
// contains filtered or unexported fields
}
DoHTransport is a DNS-over-HTTPS (RFC 8484) upstream using GET method.
func NewDoHTransport ¶
func NewDoHTransport(opts DoHTransportOpts) (*DoHTransport, error)
func (*DoHTransport) Close ¶
func (u *DoHTransport) Close() error
func (*DoHTransport) ExchangeContext ¶
type DoHTransportOpts ¶
type PipelineOpts ¶
type PipelineOpts struct {
// DialContext specifies the method to dial a connection to the server.
// DialContext MUST NOT be nil.
DialContext func(ctx context.Context) (net.Conn, error)
// DialTimeout specifies the timeout for DialFunc.
// Default is defaultDialTimeout.
DialTimeout time.Duration
// Set to true if underlayer is TCP. Which needs a 2 bytes length header.
IsTCP bool
// IdleTimeout controls the maximum idle time for each connection.
// Default is defaultIdleTimeout.
IdleTimeout time.Duration
// MaxConcurrentQuery limits the number of maximum concurrent queries
// in the connection. Default is defaultPipelineMaxConcurrent.
MaxConcurrentQuery int
Logger *zerolog.Logger
}
type PipelineTransport ¶
type PipelineTransport struct {
// contains filtered or unexported fields
}
PipelineTransport will pipeline queries as RFC 7766 6.2.1.1 suggested. It also can reuse udp socket. Since dns over udp is some kind of "pipeline".
func NewPipelineTransport ¶
func NewPipelineTransport(opts PipelineOpts) *PipelineTransport
func (*PipelineTransport) Close ¶
func (t *PipelineTransport) Close() error
Close closes PipelineTransport and all its connections. It always returns a nil error.
func (*PipelineTransport) ExchangeContext ¶
type QuicTransport ¶
type QuicTransport struct {
// contains filtered or unexported fields
}
func NewQuicTransport ¶
func NewQuicTransport(opts QuicTransportOpts) *QuicTransport
func (*QuicTransport) Close ¶
func (t *QuicTransport) Close() error
func (*QuicTransport) ExchangeContext ¶
type QuicTransportOpts ¶
type QuicTransportOpts struct {
// DialContext specifies the method to dial a connection to the server.
// DialContext MUST NOT be nil.
DialContext func(ctx context.Context) (quic.Connection, error)
// DialTimeout specifies the timeout for DialFunc.
// Default is defaultDialTimeout.
DialTimeout time.Duration
Logger *zerolog.Logger
}
type ReuseConnOpts ¶
type ReuseConnOpts struct {
// DialContext specifies the method to dial a connection to the server.
// DialContext MUST NOT be nil.
DialContext func(ctx context.Context) (net.Conn, error)
// DialTimeout specifies the timeout for DialFunc.
// Default is defaultDialTimeout.
DialTimeout time.Duration
// Default is defaultIdleTimeout
IdleTimeout time.Duration
Logger *zerolog.Logger
}
type ReuseConnTransport ¶
type ReuseConnTransport struct {
// contains filtered or unexported fields
}
ReuseConnTransport is for old tcp protocol. (no pipelining)
func NewReuseConnTransport ¶
func NewReuseConnTransport(opts ReuseConnOpts) *ReuseConnTransport
func (*ReuseConnTransport) Close ¶
func (t *ReuseConnTransport) Close() error
Close closes ReuseConnTransport and all its connections. It always returns a nil error.
func (*ReuseConnTransport) ExchangeContext ¶
func (t *ReuseConnTransport) ExchangeContext(ctx context.Context, m *dnsmsg.Msg) (*dnsmsg.Msg, error)
Note: context is not impl while waiting resp. The timeout is hardcoded, which is reuseConnQueryTimeout.
Click to show internal directories.
Click to hide internal directories.