dns

package
v0.1.62 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: GPL-3.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const AddRecord = 0x1
View Source
const RemoveRecord = 0x2

Variables

View Source
var (
	ErrNotFound = errors.New("record not found")
)

Functions

func LookupLocal added in v0.0.128

func LookupLocal(records *Records, prefix string, q dns.Question) ([]dns.RR, int, error)

func LookupRemote added in v0.0.128

func LookupRemote(records *Records, m *dns.Msg) (*dns.Msg, int, error)

func ParseQuery

func ParseQuery(records *Records, m *dns.Msg) (*dns.Msg, int, error)

Types

type ARecord

type ARecord struct {
	Addresses []string
}

func NewARecord added in v0.0.69

func NewARecord() *ARecord

func (*ARecord) Append added in v0.0.69

func (AR *ARecord) Append(ip string)

func (*ARecord) Fetch added in v0.0.125

func (AR *ARecord) Fetch(client *clients.Http, user *authentication.User, domain string) ([]string, error)

func (*ARecord) Remove added in v0.0.69

func (AR *ARecord) Remove(ip string)

func (*ARecord) ToJSON added in v0.1.42

func (AR *ARecord) ToJSON() ([]byte, error)

type Distributed added in v0.0.119

type Distributed struct {
	Domain   string
	Headless string
	IP       string
	Action   uint8
}

type Records

type Records struct {
	ARecords    *smaps.Smap
	Client      *clients.Http
	User        *authentication.User
	Lock        *sync.RWMutex
	Nameservers []string
	Search      []string
	Searcher    *Trie
	Records     chan KV.KV
}

func New

func New(agent string, client *clients.Http, user *authentication.User) *Records

func (*Records) AddARecord

func (r *Records) AddARecord(domain, ip string) ([]byte, error)

func (*Records) AddAndSave added in v0.0.125

func (r *Records) AddAndSave(domain string, ip string)

func (*Records) Find

func (r *Records) Find(domain string) ([]string, error)

func (*Records) ListenRecords added in v0.0.125

func (r *Records) ListenRecords()

func (*Records) Propose added in v0.0.119

func (r *Records) Propose(domain string, ip string, action uint8) error

func (*Records) Remove added in v0.1.30

func (r *Records) Remove(bytes []byte, domain string) (bool, error)

func (*Records) RemoveARecord

func (r *Records) RemoveARecord(domain, ip string) ([]byte, error)

func (*Records) RemoveAndSave added in v0.0.125

func (r *Records) RemoveAndSave(domain string, ip string)

func (*Records) Save added in v0.0.125

func (r *Records) Save(bytes []byte, domain string) error

type Trie added in v0.1.56

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

func NewTrie added in v0.1.56

func NewTrie() *Trie

func (*Trie) EndsWithSuffix added in v0.1.56

func (t *Trie) EndsWithSuffix(query string) (string, bool)

func (*Trie) Insert added in v0.1.56

func (t *Trie) Insert(suffix string)

type TrieNode added in v0.1.56

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

Jump to

Keyboard shortcuts

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