Movatterモバイル変換


[0]ホーム

URL:


dnsname

package
v1.92.2Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:2Imported by:59

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package dnsname contains string functions for working with DNS names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcFirstLabeladded inv1.8.0

func FirstLabel(hostnamestring)string

FirstLabel returns the first DNS label of hostname.

funcHasSuffix

func HasSuffix(name, suffixstring)bool

HasSuffix reports whether the provided name ends with thecomponent(s) in suffix, ignoring any trailing or leading dots.

If suffix is the empty string, HasSuffix always reports false.

funcNumLabelsadded inv1.8.0

func NumLabels(hostnamestring)int

NumLabels returns the number of DNS labels in hostname.If hostname is empty or the top-level name ".", returns 0.

funcSanitizeHostnameadded inv1.6.0

func SanitizeHostname(hostnamestring)string

SanitizeHostname turns hostname into a valid name label accordingtoRFC 1035.

funcSanitizeLabeladded inv1.6.0

func SanitizeLabel(labelstring)string

SanitizeLabel takes a string intended to be a DNS name labeland turns it into a valid name label according toRFC 1035.

funcTrimCommonSuffixesadded inv1.6.0

func TrimCommonSuffixes(hostnamestring)string

TrimCommonSuffixes returns hostname with some common suffixes removed.

funcTrimSuffixadded inv1.6.0

func TrimSuffix(name, suffixstring)string

TrimSuffix trims any trailing dots from a name and removes thesuffix ending if present. The name will never be returned witha trailing dot, even after trimming.

funcValidHostnameadded inv1.40.0

func ValidHostname(hostnamestring)error

ValidHostname checks if a string is a valid hostname.

funcValidLabeladded inv1.38.0

func ValidLabel(labelstring)error

ValidLabel reports whether label is a valid DNS label. All errors arevizerror.Error.

Types

typeFQDNadded inv1.8.0

type FQDNstring

A FQDN is a fully-qualified DNS name or name suffix.

funcToFQDNadded inv1.8.0

func ToFQDN(sstring) (FQDN,error)

func (FQDN)Containsadded inv1.8.0

func (fFQDN) Contains(otherFQDN)bool

func (FQDN)NumLabelsadded inv1.8.0

func (fFQDN) NumLabels()int

func (FQDN)WithTrailingDotadded inv1.8.0

func (fFQDN) WithTrailingDot()string

WithTrailingDot returns f as a string, with a trailing dot.

func (FQDN)WithoutTrailingDotadded inv1.8.0

func (fFQDN) WithoutTrailingDot()string

WithoutTrailingDot returns f as a string, with the trailing dotremoved.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp