server

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CleanupInterval  = time.Second * 120
	CleanupThreshold = 512
)
View Source
const (
	QueryTimeout = time.Second * 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ARecord

type ARecord struct {
	IPs    []net.IP
	Expire time.Time
}

type CacheServer

type CacheServer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewCacheServer

func NewCacheServer(ctx context.Context, config *dns.Config) (*CacheServer, error)

func (*CacheServer) Close

func (*CacheServer) Close()

func (*CacheServer) Get

func (s *CacheServer) Get(domain string) []net.IP

func (*CacheServer) GetCached

func (s *CacheServer) GetCached(domain string) []net.IP

func (*CacheServer) Interface

func (*CacheServer) Interface() interface{}

func (*CacheServer) Start

func (*CacheServer) Start() error

type DomainRecord

type DomainRecord struct {
	IP         []net.IP
	Expire     time.Time
	LastAccess time.Time
}

func (*DomainRecord) Expired

func (r *DomainRecord) Expired() bool

func (*DomainRecord) Inactive

func (r *DomainRecord) Inactive() bool

type LocalNameServer

type LocalNameServer struct {
}

func (*LocalNameServer) QueryA

func (*LocalNameServer) QueryA(domain string) <-chan *ARecord

type NameServer

type NameServer interface {
	QueryA(domain string) <-chan *ARecord
}

type PendingRequest

type PendingRequest struct {
	// contains filtered or unexported fields
}

type UDPNameServer

type UDPNameServer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewUDPNameServer

func NewUDPNameServer(address net.Destination, dispatcher dispatcher.Interface) *UDPNameServer

func (*UDPNameServer) AssignUnusedID

func (s *UDPNameServer) AssignUnusedID(response chan<- *ARecord) uint16

func (*UDPNameServer) BuildQueryA

func (s *UDPNameServer) BuildQueryA(domain string, id uint16) *buf.Buffer

func (*UDPNameServer) Cleanup

func (s *UDPNameServer) Cleanup()

func (*UDPNameServer) HandleResponse

func (s *UDPNameServer) HandleResponse(payload *buf.Buffer)

func (*UDPNameServer) QueryA

func (s *UDPNameServer) QueryA(domain string) <-chan *ARecord

Jump to

Keyboard shortcuts

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