url

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidURL = errors.New("invalid url")

ErrInvalidURL is returned when there's an error during the URL validation (i.e. Validate).

Functions

func Validate

func Validate(str *string) error

Validate checks if the given URL is valid and complete, following the same rules as url.ParseRequestURI, and verifying that the URL contains a host (e.g. not just a path or query).

If the URL has no protocol, it fallbacks to `http://`, by modifying the value stored in the given string pointer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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