dns

package
v0.18.7 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CONTROLLER_GROUP_DNS_CONTROLLERS = "dnscontrollers"
	CONTROLLER_GROUP_DNS_SOURCES     = "dnssources"
	CONTROLLER_GROUP_REPLICATION     = "replication"
)
View Source
const (
	DEFAULT_CLASS               = "gardendns"
	ANNOTATION_GROUP            = "dns.gardener.cloud"
	CLASS_ANNOTATION            = ANNOTATION_GROUP + "/class"
	REALM_ANNOTATION            = ANNOTATION_GROUP + "/realms"
	NOT_RATE_LIMITED_ANNOTATION = ANNOTATION_GROUP + "/not-rate-limited"
	DNS_ANNOTATION              = ANNOTATION_GROUP + "/dnsnames"
)
View Source
const (
	// AnnotationIPStack is an optional annotation for DNSEntries to specify the IP stack.
	// Values are 'ipv4', 'dual-stack', and 'ipv6'. If not specified, 'ipv4' is assumed.
	// This annotation is currently only relevant for AWS-Route53 to generate alias target A and/or AAAA records.
	AnnotationIPStack                 = ANNOTATION_GROUP + "/ip-stack"
	AnnotationValueIPStackIPv4        = "ipv4"
	AnnotationValueIPStackIPDualStack = "dual-stack"
	AnnotationValueIPStackIPv6        = "ipv6"
)
View Source
const (
	ATTR_OWNER  = "owner"
	ATTR_PREFIX = "prefix"
	ATTR_KIND   = "kind"

	ATTR_TIMESTAMP = "ts"
	ATTR_LOCKID    = "lockid"
)
View Source
const (
	RS_META       = "META"
	RS_ALIAS_A    = "ALIAS"      // provider specific alias for CNAME record (AWS alias target A)
	RS_ALIAS_AAAA = "ALIAS_AAAA" // provider specific alias for CNAME record (AWS alias target AAAA)
)
View Source
const (
	RS_TXT   = "TXT"
	RS_CNAME = "CNAME"
	RS_A     = "A"
	RS_AAAA  = "AAAA"
)
View Source
const (
	// RoutingPolicyWeighted is a weighted routing policy (supported for AWS Route 53 and Google CloudDNS)
	RoutingPolicyWeighted = "weighted"
	// RoutingPolicyLatency is a latency based routing policy (supported for AWS Route 53)
	RoutingPolicyLatency = "latency"
	// RoutingPolicyGeoLocation is a geolocation based routing policy (supported for AWS Route 53 and Google CloudDNS)
	RoutingPolicyGeoLocation = "geolocation"
	// RoutingPolicyIPBased is an IP based routing policy (supported for AWS Route 53)
	RoutingPolicyIPBased = "ip-based"
	// RoutingPolicyFailover is failover routing policy (supported for AWS Route 53)
	RoutingPolicyFailover = "failover"
)
View Source
const OPT_SETUP = "setup"
View Source
const RS_NS = "NS"

Variables

View Source
var TxtPrefix = "comment-"

Functions

func AlignHostname

func AlignHostname(host string) string

func CalcMetaRecordDomainNameForValidation added in v0.11.0

func CalcMetaRecordDomainNameForValidation(name string) string

CalcMetaRecordDomainNameForValidation returns domain name of metadata TXT DNS record if globally defined prefix is used. As it does not consider the zone, it may be wrong for the zone base domain.

func MapFromProvider

func MapFromProvider(name DNSSetName, rs *RecordSet) (DNSSetName, *RecordSet)

func MapToProvider

func MapToProvider(rtype string, dnsset *DNSSet, base string) (DNSSetName, *RecordSet)

func NormalizeHostname

func NormalizeHostname(host string) string

func SupportedRecordType

func SupportedRecordType(t string) bool

func ValidateDomainName added in v0.11.0

func ValidateDomainName(name string) error

Types

type Cache

type Cache struct {
	Groups map[GroupKey]Group
}

type DNSNameSet added in v0.13.0

type DNSNameSet map[DNSSetName]struct{}

func NewDNSNameSet added in v0.13.0

func NewDNSNameSet(names ...DNSSetName) DNSNameSet

func NewDNSNameSetFromStringSet added in v0.13.0

func NewDNSNameSetFromStringSet(dnsNames utils.StringSet, setIdentifier string) DNSNameSet

func (DNSNameSet) Add added in v0.13.0

func (s DNSNameSet) Add(name DNSSetName)

func (DNSNameSet) AddAll added in v0.13.0

func (s DNSNameSet) AddAll(names ...DNSSetName)

func (DNSNameSet) Contains added in v0.13.0

func (s DNSNameSet) Contains(name DNSSetName) bool

func (DNSNameSet) IsEmpty added in v0.13.0

func (s DNSNameSet) IsEmpty() bool

func (DNSNameSet) Remove added in v0.13.0

func (s DNSNameSet) Remove(name DNSSetName)

type DNSSet

type DNSSet struct {
	Name          DNSSetName
	Kind          string
	UpdateGroup   string
	Sets          RecordSets
	RoutingPolicy *RoutingPolicy
}

func NewDNSSet

func NewDNSSet(name DNSSetName, routingPolicy *RoutingPolicy) *DNSSet

func (*DNSSet) Clone added in v0.7.14

func (this *DNSSet) Clone() *DNSSet

func (*DNSSet) DeleteMetaAttr added in v0.11.0

func (this *DNSSet) DeleteMetaAttr(name string)

func (*DNSSet) DeleteTxtAttr added in v0.11.0

func (this *DNSSet) DeleteTxtAttr(name string)

func (*DNSSet) GetKind added in v0.11.0

func (this *DNSSet) GetKind() string

func (*DNSSet) GetMetaAttr added in v0.11.0

func (this *DNSSet) GetMetaAttr(name string) string

func (*DNSSet) GetOwner

func (this *DNSSet) GetOwner() string

func (*DNSSet) GetTxtAttr added in v0.11.0

func (this *DNSSet) GetTxtAttr(name string) string

func (*DNSSet) IsForeign

func (this *DNSSet) IsForeign(ownership Ownership) bool

func (*DNSSet) IsOwnedBy

func (this *DNSSet) IsOwnedBy(ownership Ownership) bool

func (*DNSSet) SetKind added in v0.11.0

func (this *DNSSet) SetKind(t string, prop ...bool) *DNSSet

func (*DNSSet) SetMetaAttr added in v0.11.0

func (this *DNSSet) SetMetaAttr(name string, value string)

func (*DNSSet) SetOwner

func (this *DNSSet) SetOwner(ownerid string) *DNSSet

func (*DNSSet) SetRecordSet

func (this *DNSSet) SetRecordSet(rtype string, ttl int64, values ...string)

func (*DNSSet) SetTxtAttr added in v0.11.0

func (this *DNSSet) SetTxtAttr(name string, value string)

type DNSSetName added in v0.13.0

type DNSSetName struct {
	// domain name of the record
	DNSName string
	// optional set identifier (used for record with routing policy)
	SetIdentifier string
}

func (DNSSetName) Align added in v0.13.0

func (n DNSSetName) Align() DNSSetName

func (DNSSetName) Normalize added in v0.13.0

func (n DNSSetName) Normalize() DNSSetName

func (DNSSetName) String added in v0.13.0

func (n DNSSetName) String() string

func (DNSSetName) WithDNSName added in v0.13.0

func (n DNSSetName) WithDNSName(dnsName string) DNSSetName

type DNSSets

type DNSSets map[DNSSetName]*DNSSet

func (DNSSets) AddRecordSet

func (dnssets DNSSets) AddRecordSet(name DNSSetName, policy *RoutingPolicy, rs *RecordSet)

func (DNSSets) AddRecordSetFromProvider

func (dnssets DNSSets) AddRecordSetFromProvider(dnsName string, rs *RecordSet)

func (DNSSets) AddRecordSetFromProviderEx added in v0.13.0

func (dnssets DNSSets) AddRecordSetFromProviderEx(setName DNSSetName, policy *RoutingPolicy, rs *RecordSet)

func (DNSSets) Clone

func (dnssets DNSSets) Clone() DNSSets

func (DNSSets) GetOwners added in v0.9.0

func (dnssets DNSSets) GetOwners() utils.StringSet

GetOwners returns all owners for all DNSSets

func (DNSSets) RemoveRecordSet

func (dnssets DNSSets) RemoveRecordSet(name DNSSetName, recordSetType string)

type Group

type Group struct {
	Key  GroupKey
	Info GroupInfo
	Sets map[string]*DNSSet
}

type GroupInfo

type GroupInfo interface{}

type GroupKey

type GroupKey interface {
	String() string
}

type Ownership added in v0.10.7

type Ownership interface {
	IsResponsibleFor(id string) bool
	GetIds() utils.StringSet
}

type Record

type Record struct {
	Value string
}

func (*Record) Clone

func (this *Record) Clone() *Record

type RecordSet

type RecordSet struct {
	Type      string
	TTL       int64
	IgnoreTTL bool
	Records   Records
}

func NewRecordSet

func NewRecordSet(rtype string, ttl int64, records []*Record) *RecordSet

func (*RecordSet) Add

func (this *RecordSet) Add(records ...*Record) *RecordSet

func (*RecordSet) Clone

func (this *RecordSet) Clone() *RecordSet

func (*RecordSet) DeleteAttr added in v0.11.0

func (this *RecordSet) DeleteAttr(name string)

func (*RecordSet) DiffTo

func (this *RecordSet) DiffTo(set *RecordSet) (new Records, update Records, delete Records)

func (*RecordSet) GetAttr

func (this *RecordSet) GetAttr(name string) string

func (*RecordSet) Length

func (this *RecordSet) Length() int

func (*RecordSet) Match

func (this *RecordSet) Match(set *RecordSet) bool

func (*RecordSet) RecordString

func (this *RecordSet) RecordString() string

func (*RecordSet) SetAttr

func (this *RecordSet) SetAttr(name string, value string)

type RecordSets

type RecordSets map[string]*RecordSet

func (RecordSets) Clone added in v0.7.14

func (this RecordSets) Clone() RecordSets

type Records

type Records []*Record

type RoutingPolicy added in v0.13.0

type RoutingPolicy struct {
	Type       string
	Parameters map[string]string
}

func NewRoutingPolicy added in v0.13.0

func NewRoutingPolicy(typ string, keyvalues ...string) *RoutingPolicy

func (*RoutingPolicy) CheckParameterKeys added in v0.13.0

func (p *RoutingPolicy) CheckParameterKeys(keys, optionalKeys []string) error

func (*RoutingPolicy) Clone added in v0.13.0

func (p *RoutingPolicy) Clone() *RoutingPolicy

type ZoneID added in v0.12.3

type ZoneID struct {
	ProviderType string
	ID           string
}

func NewZoneID added in v0.12.3

func NewZoneID(providerType, zoneid string) ZoneID

func (ZoneID) IsEmpty added in v0.12.3

func (z ZoneID) IsEmpty() bool

func (ZoneID) String added in v0.12.3

func (z ZoneID) String() string

Directories

Path Synopsis
raw

Jump to

Keyboard shortcuts

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