dns

package
v0.0.135 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: GPL-3.0 Imports: 17 Imported by: 3

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, m *dns.Msg) (*dns.Msg, error)

func LookupRemote added in v0.0.128

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

func ParseQuery

func ParseQuery(records *Records, m *dns.Msg) (*dns.Msg, 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 *client.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.0.125

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      *client.Http
	User        *authentication.User
	Nameservers []string
	Records     chan KV.KV
}

func New

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

func (*Records) AddARecord

func (r *Records) AddARecord(domain string, 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) RemoveARecord

func (r *Records) RemoveARecord(domain string, 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

Jump to

Keyboard shortcuts

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