domains

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package domains provides a means of testing if the host in a URL is part of a list of domains.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain added in v0.5.0

type Domain string

type Domains

type Domains []Domain

Domains validates if the host in a URL is part of a list of domains.

func New added in v0.5.1

func New(entries []string) (Domains, error)

New builds a new Domains group from the provided entries. If an entry is not a valid domain, an error is returned.

func (Domains) Domain

func (d Domains) Domain(u *url.URL) (Domain, bool)

Domain returns the domain that the host in the URL is part of. Returns false if the URL is not part of any domain.

Jump to

Keyboard shortcuts

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