substituter

package
v2.0.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameIsEmpty        = errors.New("name is empty")
	ErrTypeIsUnknown      = errors.New("type is unknown")
	ErrTypeIsNotSupported = errors.New("type is not supported")
	ErrClassIsUnknown     = errors.New("class is unknown")
	ErrIPVersionMix       = errors.New("IP version mix")
)

Functions

This section is empty.

Types

type Middleware

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

func New

func New(settings Settings) (middleware *Middleware, err error)

func (*Middleware) Stop

func (m *Middleware) Stop() (err error)

func (*Middleware) String

func (m *Middleware) String() string

func (*Middleware) Wrap

func (m *Middleware) Wrap(next dns.Handler) dns.Handler

Wrap wraps the DNS handler with the middleware.

type Settings

type Settings struct {
	Substitutions []Substitution
}

func (*Settings) Read

func (s *Settings) Read(reader *reader.Reader) (err error)

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (*Settings) String

func (s *Settings) String() string

func (*Settings) ToLinesNode

func (s *Settings) ToLinesNode() (node *gotree.Node)

func (*Settings) Validate

func (s *Settings) Validate() (err error)

type Substitution

type Substitution struct {
	Name  string       `json:"name"`
	Type  string       `json:"type"`
	Class string       `json:"class"`
	TTL   uint32       `json:"ttl"`
	IPs   []netip.Addr `json:"ips"`
}

func (Substitution) String

func (s Substitution) String() string

Jump to

Keyboard shortcuts

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