util

package
v0.0.0-...-df76fe3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ArpaSuffix is the standard suffix for PTR IP reverse lookups.
	ArpaSuffix = ".in-addr.arpa."
	// ArpaSuffixV6 is the suffix for PTR IPv6 reverse lookups.
	ArpaSuffixV6 = ".ip6.arpa."
)

Variables

This section is empty.

Functions

func ExtractIP

func ExtractIP(reverseName string) (string, error)

ExtractIP turns a standard PTR reverse record lookup name into an IP address Returns "", error if the reverseName is not a valid PTR lookup name

func GetClusterIPs

func GetClusterIPs(service *corev1.Service) []string

GetClusterIPs returns IPs set for the service

func GetSkyMsg

func GetSkyMsg(ip string, port int) (*msg.Service, string)

Returns record in a format that SkyDNS understands. Also return the hash of the record.

func HashServiceRecord

func HashServiceRecord(msg *msg.Service) string

HashServiceRecord hashes the string representation of a DNS message.

func IsServiceIPSet

func IsServiceIPSet(service *corev1.Service) bool

IsServiceIPSet aims to check if the service's ClusterIP is set or not the objective is not to perform validation here

func NewServiceRecord

func NewServiceRecord(ip string, port int) *msg.Service

NewServiceRecord creates a new service DNS message.

func ReverseArray

func ReverseArray(arr []string) []string

ReverseArray reverses an array.

func ValidateNameserverIpAndPort

func ValidateNameserverIpAndPort(nameServer string) (string, string, error)

ValidateNameserverIpAndPort splits and validates ip and port for nameserver. If there is no port in the given address, a default 53 port will be returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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