common

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLeafsTargets added in v0.7.0

func GetLeafsTargets(node *DNSTreeNode, targets *[]string) *[]string

GetLeafsTargets returns IP or CNAME of the leafs of a tree. alternatively, it can populate the passed in array with pointers to targets

func RandomizeDuration

func RandomizeDuration(variance, duration float64) time.Duration

RandomizeDuration randomizes duration for a given variance. variance is expected to be of a format 0.1 for 10%, 0.5 for 50% and so on

func RandomizeValidationDuration added in v0.8.0

func RandomizeValidationDuration(variance float64, duration time.Duration) time.Duration

RandomizeValidationDuration randomizes duration for a given variance with a min value of 1 sec variance is expected to be of a format 0.1 for 10%, 0.5 for 50% and so on

func ToEndpoints added in v0.7.0

func ToEndpoints(node *DNSTreeNode, endpoints *[]*endpoint.Endpoint) *[]*endpoint.Endpoint

ToEndpoints transforms a tree into an array of endpoints. The array could be returned or passed in to be populated

Types

type DNSTreeNode added in v0.7.0

type DNSTreeNode struct {
	Name     string
	Children []*DNSTreeNode
	DataSets []DNSTreeNodeData
}

DNSTreeNode stores a relation between endpoints that were parsed into a tree

func MakeTreeFromDNSRecord added in v0.7.0

func MakeTreeFromDNSRecord(record *v1alpha1.DNSRecord) *DNSTreeNode

func (*DNSTreeNode) RemoveNode added in v0.7.0

func (n *DNSTreeNode) RemoveNode(deleteNode *DNSTreeNode)

RemoveNode removes a node from a tree. If the node was the only child of the parent node, the parent will be removed as well unless the parent is a root node

type DNSTreeNodeData added in v0.7.0

type DNSTreeNodeData struct {
	RecordType       string
	SetIdentifier    string
	RecordTTL        endpoint.TTL
	Labels           endpoint.Labels
	ProviderSpecific endpoint.ProviderSpecific
	Targets          []string
}

DNSTreeNodeData holds a data for the enpoint(s) that correspond to this node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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