server

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: GPL-3.0 Imports: 8 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, qCtx *handler.Context, w ResponseWriter)
}

type ResponseWriter

type ResponseWriter interface {
	Write(m *dns.Msg) (n int, 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