dns

package
v1.16.108 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxLabelLength = 63

MaxLabelLength is the maximum length for a name that can be used in DNS.

Variables

View Source
var InvalidNameRe = regexp.MustCompile(`[^A-Za-z0-9\\-]+`)

InvalidNameRe is a regex that matches characters which can not be included in a DNS name.

Functions

func IsValidLabel

func IsValidLabel(name string) bool

IsValidLabel returns true if the string given is a valid DNS label (RFC 1123). Note: the only difference between RFC 1035 and RFC 1123 labels is that in RFC 1123 labels can begin with a number.

func ValidateLabel

func ValidateLabel(name string) error

ValidateLabel is similar to IsValidLabel except it returns an error instead of false when name is not a valid DNS label. The error will contain reference to what constitutes a valid DNS label.

Types

type RecursorStrategy

type RecursorStrategy string
const (
	RecursorStrategySequential RecursorStrategy = "sequential"
	RecursorStrategyRandom     RecursorStrategy = "random"
)

func (RecursorStrategy) Indexes

func (s RecursorStrategy) Indexes(max int) []int

Jump to

Keyboard shortcuts

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