server

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// listener for tcp server
	Listener net.Listener

	// socket for udp server
	PacketConn net.PacketConn

	// tcp idle timeout
	Timeout time.Duration

	// udp read buffer size
	MaxUDPPayloadSize int
}

type Handler

type Handler interface {
	ServeDNS(ctx context.Context, q *dns.Msg) (r *dns.Msg, err error)
}

type Server

type Server interface {
	ListenAndServe(h Handler) error
}

func NewTCPServer

func NewTCPServer(c *Config) Server

func NewUDPServer

func NewUDPServer(c *Config) Server

Jump to

Keyboard shortcuts

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