misc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeDYNC    = 0xFF10
	TypeDYNA    = 0xFF11
	TypeDYNAAAA = 0xFF12
	TypeDYNTXT  = 0xFF13
	TypeDYNMX   = 0xFF14
	TypeDYNPTR  = 0xFF15
	TypeDYNSRV  = 0xFF16
)
View Source
const RabbitdnsVersion string = "0.1.0"

Variables

View Source
var (
	ErrVerifyZoneEmptyApex           = errors.New("Apex node is empty.")
	ErrVerifyZoneEmptySOA            = errors.New("SOA RR is empty.")
	ErrVerifyZoneDupulicateSOA       = errors.New("More than 1 SOA RR found.")
	ErrVerifyZoneEmptyApexNS         = errors.New("Apex NS not found.")
	ErrVerifyNodeDupulicateCNAME     = errors.New("More than 1 CNAME RR found in same name.")
	ErrVerifyNodeOtherRRInCNAMENode  = errors.New("Found other RR in CNAME node.")
	ErrVerifyNodeDupulicateDNAME     = errors.New("More than 1 DNAME RR found in same name.")
	ErrVerifyNodeFoundChildNodeDNAME = errors.New("Found child node in DNAME node.")
)
View Source
var (
	ErrChildExist = errors.New("child node is exists")
)
View Source
var StaticDynamicMap = reverseUint16toUint16(DynamicStaticMap)

Functions

func FQDN

func FQDN(dn string) string

func FileExists

func FileExists(name string) bool

func IpFamily

func IpFamily(s string) int

func IsDomainName

func IsDomainName(dn string) bool

func Labels

func Labels(dn string) []string

func NewDYNARR

func NewDYNARR() dns.PrivateRdata

func SaveToFile

func SaveToFile(path string, reader io.Reader) error

Types

type DYNRR

type DYNRR struct {
	Resource string `dns:"octet"`
}

func (*DYNRR) Copy

func (rd *DYNRR) Copy(dest dns.PrivateRdata) error

func (*DYNRR) Len

func (rd *DYNRR) Len() int

func (*DYNRR) Pack

func (rd *DYNRR) Pack(buf []byte) (int, error)

func (*DYNRR) Parse

func (rd *DYNRR) Parse(txt []string) error

func (*DYNRR) String

func (rd *DYNRR) String() string

func (*DYNRR) Unpack

func (rd *DYNRR) Unpack(buf []byte) (int, error)

type Tree

type Tree struct {
	Label      string
	Paramaters map[string]interface{}
	Parent     *Tree
	Children   map[string]*Tree
	Resources  map[uint16][]dns.RR
	Auth       bool
}

func NewTree

func NewTree() *Tree

func (*Tree) AddNode

func (t *Tree) AddNode(labels []string) *Tree

func (*Tree) AddRR

func (t *Tree) AddRR(rr dns.RR) *Tree

for RR

func (*Tree) Delete

func (t *Tree) Delete(name string)

func (*Tree) DeleteAll

func (t *Tree) DeleteAll()

func (*Tree) DeleteNode

func (t *Tree) DeleteNode(labels []string, force bool) error

func (*Tree) DeleteRR

func (t *Tree) DeleteRR(rrType uint16, rr dns.RR)

func (*Tree) FindZoneCut

func (t *Tree) FindZoneCut() *Tree

func (*Tree) Get

func (t *Tree) Get(name string) (interface{}, bool)

func (*Tree) GetRR

func (t *Tree) GetRR(rrType uint16) ([]dns.RR, bool)

func (*Tree) SearchNode

func (t *Tree) SearchNode(labels []string, strict bool) *Tree

func (*Tree) Set

func (t *Tree) Set(name string, value interface{})

func (*Tree) SetRR

func (t *Tree) SetRR(rr dns.RR)

func (*Tree) VerifyNode

func (t *Tree) VerifyNode() error

func (*Tree) VerifyZone

func (t *Tree) VerifyZone(origin_labels []string) error

Jump to

Keyboard shortcuts

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