netparse

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CidrValidate

func CidrValidate(u string) error

func ContainsIP

func ContainsIP(network string, ip string) (bool, error)

func DomainValidate

func DomainValidate(u string) error

func FindManager

func FindManager(icann bool, eTLD string) string

func UrlValidate

func UrlValidate(u string) error

Types

type CidrModel

type CidrModel struct {
	CIDR    string
	IP      string
	Network string
}

CidrModel describes the CIDR model. References used. https://pkg.go.dev/net#ParseCIDR

func ParseCIDR

func ParseCIDR(c string) (*CidrModel, error)

func (*CidrModel) Validate

func (u *CidrModel) Validate() error

type DomainModel

type DomainModel struct {
	Domain    string
	Host      string
	Manager   string
	SLD       string
	Subdomain string
	TLD       string
}

DomainModel describes the domain model. References used. https://github.com/lupomontero/psl https://github.com/jpillora/go-tld https://github.com/zomasec/tld https://github.com/bobesa/go-domain-util https://github.com/joeguo/tldextract

func ParseDomain

func ParseDomain(h string) (*DomainModel, error)

type URLModel

type URLModel struct {
	Url         string
	Authority   string
	Protocol    string
	Scheme      string
	Credentials string
	Username    string
	Password    string
	Host        string
	Port        string
	Path        string
	Search      string
	Query       string
	Hash        string
	Fragment    string
}

URLModel describes the data source data model. References used. https://registry.terraform.io/modules/matti/urlparse/external/latest https://registry.terraform.io/providers/northwood-labs/corefunc/latest/docs/data-sources/url_parse

func ParseURL

func ParseURL(u string) (*URLModel, error)

func (*URLModel) Validate

func (u *URLModel) Validate() error

Jump to

Keyboard shortcuts

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