Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // DestinationPort is the port to which messages are sent (usually 53) DestinationPort uint16 // ReceiveTimeout is the time after which a message exchange times out ReceiveTimeout time.Duration // WriteTimeout is the timeout after which write operations fail. WriteTimeout time.Duration // contains filtered or unexported fields }
Client is a DNS client that exchanges UDP messages
func NewClient ¶
func NewClient(poolV4 ConnFactory, poolV6 ConnFactory, udpTimeout time.Duration, udpSize uint16) *Client
func (*Client) ResponseChan ¶
type ConnFactory ¶
type ConnFactory interface {
GetOrCreate(onReceive ReceiveCallback) (*PooledConn, error)
}
ConnFactory manages connections (e.g. a connection pool)
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) GetOrCreate ¶
func (pool *Pool) GetOrCreate(onReceive ReceiveCallback) (*PooledConn, error)
type PooledConn ¶
type PooledConn struct { *internal.MessageIdGenerator Id uuid.UUID IsIPV6 bool // contains filtered or unexported fields }
PooledConn is a wrapper around connection stored in the UDP connection pool.
func (*PooledConn) Close ¶
func (conn *PooledConn) Close()
func (*PooledConn) ID ¶
func (conn *PooledConn) ID() uuid.UUID
func (*PooledConn) IsFaulty ¶
func (conn *PooledConn) IsFaulty() bool
func (*PooledConn) StartReceiving ¶
func (conn *PooledConn) StartReceiving(onReceive ReceiveCallback)
Click to show internal directories.
Click to hide internal directories.