url

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidURL        = errors.New("invalid URL")
	ErrUnsupportedScheme = errors.New("unsupported URL scheme")
	ErrEmptyURL          = errors.New("URL cannot be empty")
)

Functions

func ExtractDomain

func ExtractDomain(rawURL string) (string, error)

ExtractDomain extracts the domain/hostname from a URL

func IsSameDomain

func IsSameDomain(url1, url2 string) (bool, error)

IsSameDomain checks if two URLs belong to the same domain

func IsValidURL

func IsValidURL(rawURL string) bool

IsValidURL validates if the given string is a valid HTTP/HTTPS URL

func NormalizeURL

func NormalizeURL(rawURL string) (string, error)

NormalizeURL normalizes a URL by removing fragments and handling trailing slashes

func ResolveURL

func ResolveURL(baseURL, relativeURL string) (string, error)

ResolveURL resolves a relative URL against a base URL to create an absolute URL

func ShouldSkipURL

func ShouldSkipURL(rawURL string) bool

ShouldSkipURL checks if a URL should be skipped based on common patterns

Types

This section is empty.

Jump to

Keyboard shortcuts

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