pool

package
v0.0.0-...-2de874f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Worker

func Worker(pool *Pool)

Types

type ByPriority

type ByPriority []Server

func (ByPriority) Len

func (servers ByPriority) Len() int

func (ByPriority) Less

func (servers ByPriority) Less(i, j int) bool

func (ByPriority) Swap

func (servers ByPriority) Swap(i, j int)

type Domain

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

func (*Domain) Add

func (domain *Domain) Add(typeId uint16, resolver chan<- *MessageResult) (resolve *Resolver)

func (*Domain) Delete

func (domain *Domain) Delete(typeId uint16) bool

func (*Domain) Get

func (domain *Domain) Get(typeId uint16) *Resolver

type DomainListing

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

func (*DomainListing) Add

func (domainListing *DomainListing) Add(name string) (domain *Domain)

func (*DomainListing) Delete

func (domainListing *DomainListing) Delete(name string)

func (*DomainListing) Get

func (domainListing *DomainListing) Get(name string) *Domain

type Message

type Message struct {
	Name string
	Type uint16
}

type MessageResult

type MessageResult struct {
	Message *dns.Msg
	Error   error
	Server  *Server
}

type Pool

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

func MakePool

func MakePool(knownServers *[]Server, serverOrder *[]Server, wg *sync.WaitGroup, timeout time.Duration) *Pool

func (Pool) Do

func (pool Pool) Do(message Message) (*dns.Msg, *Server, error)

func (*Pool) GetClientTimeout

func (pool *Pool) GetClientTimeout() time.Duration

func (*Pool) NumUpstreams

func (pool *Pool) NumUpstreams() int

func (*Pool) ServerIter

func (pool *Pool) ServerIter() (serverChan chan ServerIter, successChan chan ServerSuccess)

type Query

type Query struct {
	Message     dns.Msg
	ResolveChan chan<- *MessageResult
}

type Resolver

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

func (*Resolver) Add

func (poolResolver *Resolver) Add(resolver chan<- *MessageResult)

type Server

type Server struct {
	Name     string
	Address  string
	Port     string
	Priority uint
}

type ServerIter

type ServerIter struct {
	Server *Server
	Index  int
}

type ServerSuccess

type ServerSuccess struct {
	Succeeded bool
	Index     int
}

Jump to

Keyboard shortcuts

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