host

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Name

type Name string

Name describes a (possibly wildcarded) hostname

func (Name) IsWildCarded

func (n Name) IsWildCarded() bool

func (Name) Matches

func (n Name) Matches(o Name) bool

Matches returns true if this hostname overlaps with the other hostname. Names overlap if: - they're fully resolved (i.e. not wildcarded) and match exactly (i.e. an exact string match) - one or both are wildcarded (e.g. "*.foo.com"), in which case we use wildcard resolution rules to determine if n is covered by o or o is covered by n. e.g.:

Name("foo.com").Matches("foo.com")   = true
Name("foo.com").Matches("bar.com")   = false
Name("*.com").Matches("foo.com")     = true
Name("bar.com").Matches("*.com")     = true
Name("*.foo.com").Matches("foo.com") = false
Name("*").Matches("foo.com")         = true
Name("*").Matches("*.com")           = true

func (Name) String

func (n Name) String() string

func (Name) SubsetOf

func (n Name) SubsetOf(o Name) bool

SubsetOf returns true if this hostname is a valid subset of the other hostname. The semantics are the same as "Matches", but only in one direction (i.e., n is covered by o).

Jump to

Keyboard shortcuts

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