lib

package
v0.0.0-...-58a129c Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Overview

Package lib provides a library of commonly used functions for dns-tools

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidFQDN

func IsValidFQDN(fqdn string) error

IsValidFQDN validates a string that contains a fully qualified domain name

func IsValidIPv4

func IsValidIPv4(address string) error

IsValidIPv4 validates a string that contains an IPv4 address

func IsValidIPv6

func IsValidIPv6(address string) error

IsValidIPv6 validates a string that contains an IPv6 address

func IsValidTTL

func IsValidTTL(ttl int) error

IsValidTTL validates an integer for an acceptable DNS Time To Live value

func Lookup

func Lookup(fqdn, rtype string) ([]string, error)

Lookup looks up a resource record and returns the associated data as a string slice. It is very fast but not very precise, e.g. with CNAME records and on some systems with NS records, the results my vary. Critics may even find a way to blame systemd for this ;) related: https://github.com/systemd/systemd/issues/5897

func MakeFQDN

func MakeFQDN(name, zone string) string

MakeFQDN creafts a fully qualified domain name from a name and a zone.

func RDatasEqual

func RDatasEqual(a, b []string) bool

RDatasEqual compares two unsorted slices of resource record data and returns true if their contents are the same

func TextToQuotedStrings

func TextToQuotedStrings(s string) string

TextToQuotedStrings prepares a text for usage in a TXT record where space separated strings are quoted

Types

This section is empty.

Jump to

Keyboard shortcuts

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