arbitrary

package
v3.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRR

func SetRR(m *dns.Msg, rrs []RR)

SetRR appends rrs to m.

Types

type Arbitrary

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

func NewArbitrary

func NewArbitrary() *Arbitrary

func (*Arbitrary) BatchLoad

func (a *Arbitrary) BatchLoad(entries []string) error

BatchLoad loads records from multiple entries. If an entry has a prefix "ext:", BatchLoad loads it as a file using LoadFromFile. Otherwise, BatchLoad loads it as a text using LoadFromText.

func (*Arbitrary) BatchLoadFiles

func (a *Arbitrary) BatchLoadFiles(files []string) error

BatchLoadFiles loads records from multiple files.

func (*Arbitrary) LoadFromFile

func (a *Arbitrary) LoadFromFile(path string) error

LoadFromFile loads records from a file.

func (*Arbitrary) LoadFromReader

func (a *Arbitrary) LoadFromReader(r io.Reader) error

LoadFromReader loads records from a textual io.Reader.

func (*Arbitrary) LoadFromText

func (a *Arbitrary) LoadFromText(s string) error

LoadFromText loads records from a string. Text format: [pattern] [qclass] [qtype] [section] [RFC 1035 resource record] [qclass] and [qtype] can be numerical. e.g. dns.google IN A ANSWER dns.google. IN A 8.8.8.8 example.com IN A NA example.com. IN SOA ns.example.com. username.example.com. ( 2020091025 7200 3600 1209600 3600 )

func (*Arbitrary) Lookup

func (a *Arbitrary) Lookup(q dns.Question) []RR

func (*Arbitrary) LookupMsg

func (a *Arbitrary) LookupMsg(m *dns.Msg) *dns.Msg

type RR

type RR struct {
	Section
	RR dns.RR
}

type Section

type Section uint8
const (
	SectionAnswer Section = iota
	SectionNs     Section = iota
	SectionExtra  Section = iota
)

Jump to

Keyboard shortcuts

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