Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultDoTNetwork = "tcp-tls" DefaultDoTAddr = "1.1.1.1:853" DefaultDoTTimeout = 2 * time.Second DefaultDoTPort = 853 )
View Source
const ( DefaultDialTimeout = 500 * time.Millisecond NetUDP = "udp" NetUDP4 = "udp4" NetUDP6 = "udp6" NetTCP = "tcp" NetTCP4 = "tcp4" NetTCP6 = "tcp6" NetTCPTLS = "tcp-tls" )
View Source
const ( DefaultPlainNetwork = "udp" DefaultPlainAddr = "1.1.1.1:53" DefaultPlainTimeout = 2 * time.Second DefaultPlainPort = 53 )
View Source
const DefaultPoolSize = 128
Variables ¶
View Source
var (
ErrMalformedRsp = errors.New("malformed response")
)
Functions ¶
func NewDialer ¶
func NewDialer(opts ...DialOption) *net.Dialer
Types ¶
type DialOption ¶
type DialOption interface {
Option
// contains filtered or unexported methods
}
func WithDialTimeout ¶
func WithDialTimeout(timeout time.Duration) DialOption
func WithIface ¶
func WithIface(iface string) DialOption
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithConnPool ¶
func WithTLSConfig ¶
func WithTimeout ¶
type PlainOption ¶
type PlainOption interface {
Option
// contains filtered or unexported methods
}
type PuddlePool ¶
type PuddlePool struct {
// contains filtered or unexported fields
}
func NewPuddlePool ¶
func NewPuddlePool(dialer DialerFn, maxSize int32) (*PuddlePool, error)
func (*PuddlePool) Close ¶
func (p *PuddlePool) Close()
type Upstream ¶
type Upstream interface {
// Exchange sends req to this upstream and returns the response that has
// been received or an error if something went wrong. The implementations
// must not modify req as well as the caller must not modify it until the
// method returns. It shouldn't be called after closing.
Exchange(ctx context.Context, req *dns.Msg) (rsp *dns.Msg, err error)
Address() (addr string)
Close() error
}
Click to show internal directories.
Click to hide internal directories.