urlutil

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 5 Imported by: 0

README

urlutil - Utilities for net/url

Go Reference test codecov

Installation

go get github.com/m0t0k1ch1-go/urlutil

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPURL

type HTTPURL struct {
	// contains filtered or unexported fields
}

HTTPURL represents a HTTP(S) URL.

func MustNewHTTPURL

func MustNewHTTPURL(u *url.URL) HTTPURL

MustNewHTTPURL panics if the input is invalid.

func MustNewHTTPURLFromString

func MustNewHTTPURLFromString(s string) HTTPURL

MustNewHTTPURLFromString panics if the input is invalid.

func NewHTTPURL

func NewHTTPURL(u *url.URL) (HTTPURL, error)

NewHTTPURL returns a new HTTPURL.

func NewHTTPURLFromString

func NewHTTPURLFromString(s string) (HTTPURL, error)

NewHTTPURLFromString returns a new HTTPURL from a string.

func (HTTPURL) MarshalJSON

func (hu HTTPURL) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler. It returns the value as a JSON string.

func (*HTTPURL) Scan

func (hu *HTTPURL) Scan(src any) error

Scan implements sql.Scanner. It accepts a string or []byte.

func (HTTPURL) String

func (hu HTTPURL) String() string

String implements fmt.Stringer. It returns the value as a string.

func (HTTPURL) URL

func (hu HTTPURL) URL() *url.URL

URL returns a copy of the underlying url.URL.

func (*HTTPURL) UnmarshalJSON

func (hu *HTTPURL) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler. It accepts a JSON string.

func (HTTPURL) Value

func (hu HTTPURL) Value() (driver.Value, error)

Value implements driver.Valuer. It returns the value as a string.

Jump to

Keyboard shortcuts

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