Version: v1.8.7 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2021 License: GPL-3.0 Imports: 22 Imported by: 1




This section is empty.


This section is empty.


This section is empty.


type FastUpstream

type FastUpstream struct {
	// contains filtered or unexported fields

func NewFastUpstream added in v1.8.0

func NewFastUpstream(addr string, options ...Option) (*FastUpstream, error)

func (*FastUpstream) Address added in v1.8.0

func (u *FastUpstream) Address() string

func (*FastUpstream) Exchange

func (u *FastUpstream) Exchange(q *dns.Msg) (r *dns.Msg, err error)

type Option

type Option func(u *FastUpstream) error

func WithDialAddr added in v1.8.0

func WithDialAddr(s string) Option

func WithIdleTimeout added in v1.8.0

func WithIdleTimeout(d time.Duration) Option

func WithInsecureSkipVerify added in v1.8.0

func WithInsecureSkipVerify(b bool) Option

func WithLogger added in v1.8.0

func WithLogger(l *zap.Logger) Option

func WithMaxConns added in v1.8.0

func WithMaxConns(n int) Option

func WithReadTimeout added in v1.8.0

func WithReadTimeout(d time.Duration) Option

func WithRootCAs added in v1.8.0

func WithRootCAs(cp *x509.CertPool) Option

func WithSocks5 added in v1.8.0

func WithSocks5(s string) Option

type Transport added in v1.5.2

type Transport struct {
	// Nil logger disables logging.
	Logger *zap.Logger

	// The following funcs cannot be nil.
	DialFunc  func() (net.Conn, error)
	WriteFunc func(c io.Writer, m *dns.Msg) (n int, err error)
	ReadFunc  func(c io.Reader) (m *dns.Msg, n int, err error)
	// MaxConns controls the maximum connections Transport can open.
	// It includes dialing connections.
	// Default is 1.
	MaxConns int

	// IdleTimeout controls the maximum idle time for each connection.
	// If IdleTimeout <= 0, Transport will not reuse connections.
	IdleTimeout time.Duration

	// Timeout controls the read timeout for each read operation.
	// Default is defaultReadTimeout.
	Timeout time.Duration
	// contains filtered or unexported fields

func (*Transport) Exchange added in v1.5.2

func (t *Transport) Exchange(q *dns.Msg) (r *dns.Msg, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL