xdns

package
v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClient

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

func WithServer

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(question 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

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

func (*ConfigDNS) Default

func (v *ConfigDNS) Default()

type HandlerDNS

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

func DefaultExchanger

func DefaultExchanger(dns ...string) HandlerDNS

type Option

type Option func(*dns.Client)

func OptionNetDOT

func OptionNetDOT() Option

func OptionNetTCP

func OptionNetTCP() Option

func OptionNetUDP

func OptionNetUDP() Option

type Server

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

func NewServer

func NewServer(conf Config) *Server

func (*Server) Down

func (v *Server) Down() error

func (*Server) HandleFunc

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