dns

package
v1.16.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MPL-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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