Documentation ¶
Index ¶
- type FastUpstream
- type Option
- func WithDialAddr(s string) Option
- func WithIdleTimeout(d time.Duration) Option
- func WithInsecureSkipVerify(b bool) Option
- func WithLogger(l *zap.Logger) Option
- func WithMaxConns(n int) Option
- func WithReadTimeout(d time.Duration) Option
- func WithRootCAs(cp *x509.CertPool) Option
- func WithSocks5(s string) Option
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FastUpstream ¶
type FastUpstream struct {
// contains filtered or unexported fields
}
func NewFastUpstream ¶
func NewFastUpstream(addr string, options ...Option) (*FastUpstream, error)
func (*FastUpstream) Address ¶
func (u *FastUpstream) Address() string
type Option ¶
type Option func(u *FastUpstream) error
func WithDialAddr ¶
func WithIdleTimeout ¶
func WithInsecureSkipVerify ¶
func WithLogger ¶
func WithMaxConns ¶
func WithReadTimeout ¶
func WithRootCAs ¶
func WithSocks5 ¶
type Transport ¶
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 }
Click to show internal directories.
Click to hide internal directories.