types

package
v0.0.0-...-4d64e5c Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IpMaskWhite = iota
	IpMaskGrey
	IpMaskBlack
)
View Source
const (
	ExactMatch = iota
	WildCardMatch
	EmptyNonterminalMatch
	CEMatch
	NoMatch
)
View Source
const (
	TypeANAME = 500
)

Variables

View Source
var SupportedTypes = map[string]struct{}{"a": {}, "aaaa": {}, "cname": {}, "txt": {}, "ns": {}, "mx": {}, "srv": {}, "caa": {}, "ptr": {}, "tlsa": {}, "ds": {}, "aname": {}, "soa": {}}
View Source
var TypeToRRSet = map[string]func() RRSet{
	"a":     func() RRSet { return new(IP_RRSet) },
	"aaaa":  func() RRSet { return new(IP_RRSet) },
	"cname": func() RRSet { return new(CNAME_RRSet) },
	"txt":   func() RRSet { return new(TXT_RRSet) },
	"ns":    func() RRSet { return new(NS_RRSet) },
	"mx":    func() RRSet { return new(MX_RRSet) },
	"srv":   func() RRSet { return new(SRV_RRSet) },
	"caa":   func() RRSet { return new(CAA_RRSet) },
	"ptr":   func() RRSet { return new(PTR_RRSet) },
	"tlsa":  func() RRSet { return new(TLSA_RRSet) },
	"ds":    func() RRSet { return new(DS_RRSet) },
	"soa":   func() RRSet { return new(SOA_RRSet) },
	"aname": func() RRSet { return new(ANAME_RRSet) },
}

Functions

func ReverseName

func ReverseName(zone string) []byte

func SplitSets

func SplitSets(rrs []dns.RR) map[RRSetKey][]dns.RR

Types

type ANAME_RRSet

type ANAME_RRSet struct {
	GenericRRSet
	Location string `json:"location,omitempty"`
}

func (*ANAME_RRSet) Empty

func (rrset *ANAME_RRSet) Empty() bool

func (*ANAME_RRSet) Value

func (*ANAME_RRSet) Value(string) []dns.RR

type CAA_RR

type CAA_RR struct {
	Tag   string `json:"tag"`
	Value string `json:"value"`
	Flag  uint8  `json:"flag"`
}

type CAA_RRSet

type CAA_RRSet struct {
	GenericRRSet
	Data []CAA_RR `json:"records,omitempty"`
}

func (*CAA_RRSet) Empty

func (rrset *CAA_RRSet) Empty() bool

func (*CAA_RRSet) Value

func (rrset *CAA_RRSet) Value(name string) []dns.RR

type CNAME_RRSet

type CNAME_RRSet struct {
	GenericRRSet
	Host string `json:"host"`
}

func (*CNAME_RRSet) Empty

func (rrset *CNAME_RRSet) Empty() bool

func (*CNAME_RRSet) Value

func (rrset *CNAME_RRSet) Value(name string) []dns.RR

type DS_RR

type DS_RR struct {
	KeyTag     uint16 `json:"key_tag"`
	Algorithm  uint8  `json:"algorithm"`
	DigestType uint8  `json:"digest_type"`
	Digest     string `json:"digest"`
}

type DS_RRSet

type DS_RRSet struct {
	GenericRRSet
	Data []DS_RR `json:"records,omitempty"`
}

func (*DS_RRSet) Empty

func (rrset *DS_RRSet) Empty() bool

func (*DS_RRSet) Value

func (rrset *DS_RRSet) Value(name string) []dns.RR

type GenericRRSet

type GenericRRSet struct {
	TtlValue uint32 `json:"ttl,omitempty"`
}

func (*GenericRRSet) Ttl

func (rrset *GenericRRSet) Ttl() uint32

type HealthCheckItem

type HealthCheckItem struct {
	Protocol  string    `json:"protocol,omitempty"`
	Uri       string    `json:"uri,omitempty"`
	Port      int       `json:"port,omitempty"`
	Status    int       `json:"status,omitempty"`
	LastCheck time.Time `json:"lastcheck,omitempty"`
	Timeout   int       `json:"timeout,omitempty"`
	UpCount   int       `json:"up_count,omitempty"`
	DownCount int       `json:"down_count,omitempty"`
	Enable    bool      `json:"enable,omitempty"`
	DomainId  string    `json:"domain_uuid,omitempty"`
	Host      string    `json:"host,omitempty"`
	Ip        string    `json:"ip,omitempty"`
	Error     error     `json:"-"`
}

type IP_RR

type IP_RR struct {
	Weight  int      `json:"weight,omitempty"`
	Ip      net.IP   `json:"ip"`
	Country []string `json:"country,omitempty"`
	ASN     []uint   `json:"asn,omitempty"`
}

type IP_RRSet

type IP_RRSet struct {
	GenericRRSet
	FilterConfig      IpFilterConfig      `json:"filter,omitempty"`
	HealthCheckConfig IpHealthCheckConfig `json:"health_check,omitempty"`
	Data              []IP_RR             `json:"records,omitempty"`
}

func (*IP_RRSet) Empty

func (rrset *IP_RRSet) Empty() bool

func (*IP_RRSet) Value

func (*IP_RRSet) Value(string) []dns.RR

type IpFilterConfig

type IpFilterConfig struct {
	Count     string `json:"count,omitempty"`      // "multi", "single"
	Order     string `json:"order,omitempty"`      // "weighted", "rr", "none"
	GeoFilter string `json:"geo_filter,omitempty"` // "country", "location", "asn", "asn+country", "none"
}

type IpHealthCheckConfig

type IpHealthCheckConfig struct {
	Protocol  string `json:"protocol,omitempty"`
	Uri       string `json:"uri,omitempty"`
	Port      int    `json:"port,omitempty"`
	Timeout   int    `json:"timeout,omitempty"`
	UpCount   int    `json:"up_count,omitempty"`
	DownCount int    `json:"down_count,omitempty"`
	Enable    bool   `json:"enable,omitempty"`
}

type MX_RR

type MX_RR struct {
	Host       string `json:"host"`
	Preference uint16 `json:"preference"`
}

type MX_RRSet

type MX_RRSet struct {
	GenericRRSet
	Data []MX_RR `json:"records,omitempty"`
}

func (*MX_RRSet) Empty

func (rrset *MX_RRSet) Empty() bool

func (*MX_RRSet) Value

func (rrset *MX_RRSet) Value(name string) []dns.RR

type NS_RR

type NS_RR struct {
	Host string `json:"host"`
}

type NS_RRSet

type NS_RRSet struct {
	GenericRRSet
	Data []NS_RR `json:"records,omitempty"`
}

func (*NS_RRSet) Empty

func (rrset *NS_RRSet) Empty() bool

func (*NS_RRSet) Value

func (rrset *NS_RRSet) Value(name string) []dns.RR

type PTR_RRSet

type PTR_RRSet struct {
	GenericRRSet
	Domain string `json:"domain"`
}

func (*PTR_RRSet) Empty

func (rrset *PTR_RRSet) Empty() bool

func (*PTR_RRSet) Value

func (rrset *PTR_RRSet) Value(name string) []dns.RR

type RRSet

type RRSet interface {
	Value(name string) []dns.RR
	Empty() bool
	Ttl() uint32
}

type RRSetKey

type RRSetKey struct {
	QName string
	QType uint16
}

type SOA_RRSet

type SOA_RRSet struct {
	GenericRRSet
	Ns      string   `json:"ns"`
	MBox    string   `json:"mbox"`
	Data    *dns.SOA `json:"-"`
	Refresh uint32   `json:"refresh"`
	Retry   uint32   `json:"retry"`
	Expire  uint32   `json:"expire"`
	MinTtl  uint32   `json:"minttl"`
	Serial  uint32   `json:"serial"`
}

func (*SOA_RRSet) Empty

func (rrset *SOA_RRSet) Empty() bool

func (*SOA_RRSet) Value

func (rrset *SOA_RRSet) Value(name string) []dns.RR

type SRV_RR

type SRV_RR struct {
	Target   string `json:"target"`
	Priority uint16 `json:"priority"`
	Weight   uint16 `json:"weight"`
	Port     uint16 `json:"port"`
}

type SRV_RRSet

type SRV_RRSet struct {
	GenericRRSet
	Data []SRV_RR `json:"records,omitempty"`
}

func (*SRV_RRSet) Empty

func (rrset *SRV_RRSet) Empty() bool

func (*SRV_RRSet) Value

func (rrset *SRV_RRSet) Value(name string) []dns.RR

type TLSA_RR

type TLSA_RR struct {
	Usage        uint8  `json:"usage"`
	Selector     uint8  `json:"selector"`
	MatchingType uint8  `json:"matching_type"`
	Certificate  string `json:"certificate"`
}

type TLSA_RRSet

type TLSA_RRSet struct {
	GenericRRSet
	Data []TLSA_RR `json:"records,omitempty"`
}

func (*TLSA_RRSet) Empty

func (rrset *TLSA_RRSet) Empty() bool

func (*TLSA_RRSet) Value

func (rrset *TLSA_RRSet) Value(name string) []dns.RR

type TXT_RR

type TXT_RR struct {
	Text string `json:"text"`
}

type TXT_RRSet

type TXT_RRSet struct {
	GenericRRSet
	Data []TXT_RR `json:"records,omitempty"`
}

func (*TXT_RRSet) Empty

func (rrset *TXT_RRSet) Empty() bool

func (*TXT_RRSet) Value

func (rrset *TXT_RRSet) Value(name string) []dns.RR

type Zone

type Zone struct {
	Name          string
	Config        *ZoneConfig
	LocationsTree *iradix.Tree
	LocationsList []string
	ZSK           *ZoneKey
	KSK           *ZoneKey
	DnsKeySig     dns.RR
	CacheTimeout  int64
}

func NewZone

func NewZone(zone string, locations []string, configStr string) *Zone

func (*Zone) FindLocation

func (z *Zone) FindLocation(query string) (string, int)

type ZoneConfig

type ZoneConfig struct {
	DomainId        string     `json:"domain_id,omitempty"`
	SOA             *SOA_RRSet `json:"soa,omitempty"`
	DnsSec          bool       `json:"dnssec,omitempty"`
	CnameFlattening bool       `json:"cname_flattening,omitempty"`
}

func ZoneConfigFromJson

func ZoneConfigFromJson(zone string, configStr string) *ZoneConfig

type ZoneKey

type ZoneKey struct {
	DnsKey        *dns.DNSKEY
	PrivateKey    crypto.PrivateKey
	KeyInception  uint32
	KeyExpiration uint32
}

Jump to

Keyboard shortcuts

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