dispatcher

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUpstreamsFailed all upstreams are failed or not respond in time.
	ErrUpstreamsFailed = errors.New("all upstreams failed or not respond in time")
)

Functions

This section is empty.

Types

type Dispatcher

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

Dispatcher represents a dns query dispatcher

func InitDispatcher

func InitDispatcher(c *config.Config) (*Dispatcher, error)

InitDispatcher inits a dispatcher from configuration

func (*Dispatcher) ServeDNS

func (d *Dispatcher) ServeDNS(ctx context.Context, q *dns.Msg) (r *dns.Msg, err error)

ServeDNS sends q to upstreams and return first valid result.

func (*Dispatcher) StartServer added in v1.3.1

func (d *Dispatcher) StartServer() error

StartServer starts mos-chinadns. Will always return a non-nil err.

Directories

Path Synopsis
logger for the whole dispatcher package
logger for the whole dispatcher package

Jump to

Keyboard shortcuts

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