exurl

package
v0.4.43 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type URL

type URL struct {
	Raw string
	// contains filtered or unexported fields
}

func Parse

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

func (*URL) GetFragment

func (u *URL) GetFragment() string

GetFragment returns the fragment without '#'

func (*URL) GetHost

func (u *URL) GetHost() string

GetHost returns host or host:port

func (*URL) GetHostname

func (u *URL) GetHostname() string

GetHostname returns u.GetHost(), stripping any valid port number if present.

If the result is enclosed in square brackets, as literal IPv6 addresses are, the square brackets are removed from the result.

func (*URL) GetPath

func (u *URL) GetPath() string

func (*URL) GetPathLastPart

func (u *URL) GetPathLastPart() string

func (*URL) GetPathParts

func (u *URL) GetPathParts() []string

func (*URL) GetPort

func (u *URL) GetPort() string

GetPort returns the port part of u.GetHost(), without the leading colon.

If u.Host doesn't contain a valid numeric port, Port returns an empty string.

func (*URL) GetQuery

func (u *URL) GetQuery() url.Values

GetQuery parses RawQuery and returns the corresponding values. It silently discards malformed value pairs. To check errors use ParseQuery.

func (*URL) GetQueryString

func (u *URL) GetQueryString() string

GetQueryString returns encoded query values, without '?'

TODO: please use GetRawQuery now

func (*URL) GetRawQuery

func (u *URL) GetRawQuery() string

GetRawQuery returns encoded query values, without '?'

func (*URL) GetScheme

func (u *URL) GetScheme() string

func (*URL) GetSuffix

func (u *URL) GetSuffix() string

func (*URL) GetUser

func (u *URL) GetUser() *url.Userinfo

func (*URL) Unwrap

func (u *URL) Unwrap() *url.URL

Jump to

Keyboard shortcuts

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