domain

package
v0.28.8 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: BSD-3-Clause Imports: 2 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain string

func FromString

func FromString(s string) (Domain, error)

FromString creates a Domain from a string, converting it to punycode.

func (Domain) SafeString

func (d Domain) SafeString() string

SafeString converts the Domain to a non-punycode string, falling back to the original string if conversion fails.

func (Domain) String

func (d Domain) String() (string, error)

String converts the Domain to a non-punycode string.

type List

type List []Domain

func FromPunycodeList

func FromPunycodeList(s []string) List

FromPunycodeList creates a List from a slice of Punycode-encoded domain strings.

func FromStringList

func FromStringList(s []string) (List, error)

FromStringList creates a DomainList from a slice of string.

func (List) PunycodeString

func (d List) PunycodeString() string

PunycodeString converts the List to a comma-separated string of Punycode-encoded domains.

func (List) SafeString

func (d List) SafeString() string

SafeString converts List to a comma-separated non-punycode string. If a domain cannot be converted, the original string is used.

func (List) String

func (d List) String() (string, error)

String converts List to a comma-separated string.

func (List) ToPunycodeList

func (d List) ToPunycodeList() []string

ToPunycodeList converts the List to a slice of Punycode-encoded domain strings.

func (List) ToSafeStringList

func (d List) ToSafeStringList() []string

ToSafeStringList converts the List to a slice of non-punycode strings. If a domain cannot be converted, the original string is used.

func (List) ToStringList

func (d List) ToStringList() ([]string, error)

ToStringList converts a List to a slice of string.

Jump to

Keyboard shortcuts

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