Documentation
¶
Index ¶
- func AddChild(parent *DNSTreeNode, child *DNSTreeNode)
- func AddLabelToBranch(node *DNSTreeNode, branch, label, value string)
- func AddLabelToTree(node *DNSTreeNode, label, value string)
- func GetLeafsTargets(node *DNSTreeNode, targets *[]string) *[]string
- func HasLabelForBranch(node *DNSTreeNode, branch, label, value string) bool
- func HashRootHost(rootHost string) string
- func MergeLabels(object metav1.Object, labels map[string]string) bool
- func ParseGVKString(gvkStr string) (schema.GroupVersionKind, error)
- func ParseGVRString(gvkStr string) (schema.GroupVersionResource, error)
- func PropagateStoppableLabel(node *DNSTreeNode, propLabel, value, stopLabel string)
- func RandomizeDuration(variance, duration float64) time.Duration
- func RandomizeValidationDuration(variance float64, duration time.Duration) time.Duration
- func RemoveLabelFromParents(node *DNSTreeNode, label string)
- func RemoveLabelFromTree(node *DNSTreeNode, label string)
- func ToEndpoints(node *DNSTreeNode, endpoints *[]*endpoint.Endpoint) *[]*endpoint.Endpoint
- type DNSTreeNode
- type DNSTreeNodeData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddChild ¶ added in v0.13.0
func AddChild(parent *DNSTreeNode, child *DNSTreeNode)
func AddLabelToBranch ¶ added in v0.13.0
func AddLabelToBranch(node *DNSTreeNode, branch, label, value string)
func AddLabelToTree ¶ added in v0.13.0
func AddLabelToTree(node *DNSTreeNode, label, value string)
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 HasLabelForBranch ¶ added in v0.13.0
func HasLabelForBranch(node *DNSTreeNode, branch, label, value string) bool
func HashRootHost ¶ added in v0.15.0
HashRootHost generates a hash value of the given root host with a fixed length of 8
func MergeLabels ¶ added in v0.15.0
MergeLabels combines the map of labels to the existing labels on an object
func ParseGVKString ¶ added in v0.15.0
func ParseGVKString(gvkStr string) (schema.GroupVersionKind, error)
func ParseGVRString ¶ added in v0.15.0
func ParseGVRString(gvkStr string) (schema.GroupVersionResource, error)
func PropagateStoppableLabel ¶ added in v0.13.0
func PropagateStoppableLabel(node *DNSTreeNode, propLabel, value, stopLabel string)
func RandomizeDuration ¶
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
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 RemoveLabelFromParents ¶ added in v0.13.0
func RemoveLabelFromParents(node *DNSTreeNode, label string)
func RemoveLabelFromTree ¶ added in v0.13.0
func RemoveLabelFromTree(node *DNSTreeNode, label string)
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
Parent *DNSTreeNode
}
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