uri

package
v0.16.0-beta05 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUriIsRelative = errors.New("uri is relative")

Functions

This section is empty.

Types

type Uri

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

Uri define a read-only absolute URI object.

func Parse

func Parse(uriStr string) (Uri, error)

Parse parses an URI and normalize it. Raw query args are copied and stored if extractQuery is true.

func ParseBytes

func ParseBytes(uri []byte) (Uri, error)

ParseBytes parses an URI and normalize it. Raw query args are copied and stored if extractQuery is true.

func (*Uri) Hash

func (u *Uri) Hash() string

Hash returns hash of URI: bang for https://www.example.com:8080/foo/bar?q=baz#bang

func (*Uri) Host

func (u *Uri) Host() string

Host returns host of URI: www.example.com:8080 for https://www.example.com:8080/foo/bar?q=baz#bang

func (*Uri) IsValid

func (u *Uri) IsValid() bool

IsValid returns true if data was successfully parsed.

func (*Uri) Path

func (u *Uri) Path() string

Path returns normalized path of URI: /foo/bar for https://www.example.com:8080/foo/bar?q=baz#bang

func (*Uri) QueryString

func (u *Uri) QueryString() string

QueryBytes returns extracted query bytes (extractQuery must be true when calling Parse / ParseBytes): q=baz for https://www.example.com:8080/foo/bar?q=baz#bang

func (*Uri) Scheme

func (u *Uri) Scheme() string

Scheme returns scheme of URI: https for https://www.example.com:8080/foo/bar?q=baz#bang

func (Uri) String

func (u Uri) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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