rrdb

package
Version: v0.0.0-...-58a129c Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailserver

type Mailserver struct {
	Preference uint16
	Hostname   string
}

Mailserver holds the preference and hostname of a single mailserver's entry

type RRDB

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

RRDB holds a resource record database

func New

func New() *RRDB

New creates a new label database instance

func NewFromDirectory

func NewFromDirectory(directory string) (*RRDB, error)

NewFromDirectory creates a new database from a directory of YAML-formatted zonedata files

func (*RRDB) A

func (db *RRDB) A(fqdn string, ttl int) (*Record, error)

A retrieves the A record of a FQDN. If the record has no individual TTL, a default TTL (paramter ttl) will be inserted.

func (*RRDB) AAAA

func (db *RRDB) AAAA(fqdn string, ttl int) (*Record, error)

AAAA retrieves the AAAA record of a FQDN. If the record has no individual TTL, a default TTL (paramter ttl) will be inserted.

func (*RRDB) AddTXT

func (db *RRDB) AddTXT(fqdn string, ttl int, rdata string) error

AddTXT adds a TXT record to a FQDN

func (*RRDB) CNAME

func (db *RRDB) CNAME(fqdn string, ttl int) (*Record, error)

CNAME retrieves the CNAME record of a FQDN. If the record has no individual TTL, a default TTL (paramter ttl) will be inserted.

func (*RRDB) MX

func (db *RRDB) MX(fqdn string, ttl int) (*Record, error)

MX retrieves the MX record of a FQDN. If the record has no individual TTL, a default TTL (paramter ttl) will be inserted.

func (*RRDB) NS

func (db *RRDB) NS(fqdn string, ttl int) (*Record, error)

NS retrieves the NS record of a FQDN. If the record has no individual TTL, a default TTL (paramter ttl) will be inserted.

func (*RRDB) Records

func (db *RRDB) Records(fqdn string, ttl int) ([]*Record, error)

Records retrieves all records of a FQDN

func (*RRDB) SetA

func (db *RRDB) SetA(fqdn string, ttl int, rdatas []string) error

SetA adds an A record to a FQDN

func (*RRDB) SetAAAA

func (db *RRDB) SetAAAA(fqdn string, ttl int, rdatas []string) error

SetAAAA adds an AAAA record to a FQDN

func (*RRDB) SetCNAME

func (db *RRDB) SetCNAME(fqdn string, ttl int, rdata string) error

SetCNAME sets the CNAME record of a FQDN

func (*RRDB) SetMX

func (db *RRDB) SetMX(fqdn string, ttl int, rdatas []string) error

SetMX adds a MX record to a FQDN

func (*RRDB) SetNS

func (db *RRDB) SetNS(fqdn string, ttl int, rdatas []string) error

SetNS sets the NS records of a FQDN

func (*RRDB) TXT

func (db *RRDB) TXT(fqdn string, ttl int) (*Record, error)

TXT retrieves the TXT record of a FQDN. If the record has no individual TTL, a default TTL (paramter ttl) will be inserted.

func (*RRDB) Zone

func (db *RRDB) Zone(fqdn string, ttl int) ([]*Record, error)

Zone retrieves all records of a FQDN and all records of all its children

type Record

type Record struct {
	FQDN   string
	RType  string
	TTL    int
	RDatas []string
}

Record holds a DNS resource record of a particular type for a FQDN

Source Files

Jump to

Keyboard shortcuts

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