url

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: 0BSD Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinPath

func JoinPath(base string, elem ...string) (result string, err error)

func PathEscape

func PathEscape(s string) string

func PathUnescape

func PathUnescape(s string) (string, error)

func QueryEscape

func QueryEscape(s string) string

func QueryUnescape

func QueryUnescape(s string) (string, error)

Types

type Error

type Error struct {
	Op  string
	URL string
	Err error
}

func (*Error) Error

func (*Error) Error() string

func (*Error) Temporary

func (*Error) Temporary() bool

func (*Error) Timeout

func (*Error) Timeout() bool

func (*Error) Unwrap

func (*Error) Unwrap() error

type EscapeError

type EscapeError string

func (EscapeError) Error

func (EscapeError) Error() string

type InvalidHostError

type InvalidHostError string

func (InvalidHostError) Error

func (InvalidHostError) Error() string

type URL

type URL struct {
	Scheme      string
	Opaque      string
	User        *Userinfo
	Host        string
	Path        string
	Fragment    string
	RawQuery    string
	RawPath     string
	RawFragment string
	ForceQuery  bool
	OmitHost    bool
}

func Parse

func Parse(rawURL string) (*URL, error)

func ParseRequestURI

func ParseRequestURI(rawURL string) (*URL, error)

func (*URL) AppendBinary

func (*URL) AppendBinary(b []byte) ([]byte, error)

func (*URL) Clone

func (*URL) Clone() *URL

func (*URL) EscapedFragment

func (*URL) EscapedFragment() string

func (*URL) EscapedPath

func (*URL) EscapedPath() string

func (*URL) Hostname

func (*URL) Hostname() string

func (*URL) IsAbs

func (*URL) IsAbs() bool

func (*URL) JoinPath

func (*URL) JoinPath(elem ...string) *URL

func (*URL) MarshalBinary

func (*URL) MarshalBinary() (text []byte, err error)

func (*URL) Parse

func (*URL) Parse(ref string) (*URL, error)

func (*URL) Port

func (*URL) Port() string

func (*URL) Query

func (*URL) Query() Values

func (*URL) Redacted

func (*URL) Redacted() string

func (*URL) RequestURI

func (*URL) RequestURI() string

func (*URL) ResolveReference

func (*URL) ResolveReference(ref *URL) *URL

func (*URL) String

func (*URL) String() string

func (*URL) UnmarshalBinary

func (*URL) UnmarshalBinary(text []byte) error

type Userinfo

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

func User

func User(username string) *Userinfo

func UserPassword

func UserPassword(username string, password string) *Userinfo

func (*Userinfo) Password

func (*Userinfo) Password() (string, bool)

func (*Userinfo) String

func (*Userinfo) String() string

func (*Userinfo) Username

func (*Userinfo) Username() string

type Values

type Values map[string][]string

func ParseQuery

func ParseQuery(query string) (Values, error)

func (Values) Add

func (Values) Add(key string, value string)

func (Values) Clone

func (Values) Clone() Values

func (Values) Del

func (Values) Del(key string)

func (Values) Encode

func (Values) Encode() string

func (Values) Get

func (Values) Get(key string) string

func (Values) Has

func (Values) Has(key string) bool

func (Values) Set

func (Values) Set(key string, value string)

Jump to

Keyboard shortcuts

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