xdns

package module
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: BSD-3-Clause Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClient added in v0.3.5

func WithClient(opts ...Option) plugins.Plugin

func WithServer added in v0.3.5

func WithServer() plugins.Plugin

Types

type Client

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

func NewClient

func NewClient(opts ...Option) *Client

func (*Client) Exchange

func (v *Client) Exchange(q []dns.Question) ([]dns.RR, error)

func (*Client) SetZoneResolver

func (v *Client) SetZoneResolver(r ZoneResolver)

type Config

type Config struct {
	Addr    string        `yaml:"addr"`
	Timeout time.Duration `yaml:"timeout"`
}

type ConfigDNS added in v0.3.5

type ConfigDNS struct {
	DNS Config `yaml:"dns"`
}

func (*ConfigDNS) Default added in v0.3.5

func (v *ConfigDNS) Default()

type HandlerDNS added in v0.1.1

type HandlerDNS interface {
	Exchange(q []dns.Question) ([]dns.RR, error)
}

func DefaultExchanger

func DefaultExchanger(dns ...string) HandlerDNS

type Option added in v0.3.5

type Option func(*dns.Client)

func OptionNetDOT added in v0.3.5

func OptionNetDOT() Option

func OptionNetTCP added in v0.3.5

func OptionNetTCP() Option

func OptionNetUDP added in v0.3.5

func OptionNetUDP() Option

type Server

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

func NewServer

func NewServer(conf Config, l xlog.Logger) *Server

func (*Server) Down

func (v *Server) Down() error

func (*Server) HandleFunc added in v0.1.1

func (v *Server) HandleFunc(r HandlerDNS)

func (*Server) Up

func (v *Server) Up(ctx xc.Context) error

type ZoneResolve

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

func NewSimpleZoneResolve

func NewSimpleZoneResolve(dns ...string) *ZoneResolve

func (*ZoneResolve) Resolve

func (v *ZoneResolve) Resolve(name string) string

type ZoneResolver

type ZoneResolver interface {
	Resolve(name string) string
}

Jump to

Keyboard shortcuts

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