urlx

package
v0.0.628 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 84

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendPaths added in v0.0.37

func AppendPaths(u *url.URL, paths ...string) (ep *url.URL)

AppendPaths appends the provided paths to the url.

func Copy added in v0.0.37

func Copy(src *url.URL) *url.URL

Copy returns a copy of the input url.

func CopyWithQuery added in v0.0.37

func CopyWithQuery(src *url.URL, query url.Values) *url.URL

CopyWithQuery returns a copy of the input url with the given query parameters

func GetURLFilePath added in v0.0.156

func GetURLFilePath(u *url.URL) string

GetURLFilePath returns the path of a URL that is compatible with the runtime os filesystem

func MustJoin

func MustJoin(first string, parts ...string) string

MustJoin joins the paths of two URLs. Fatals if first is not a DSN.

func Parse added in v0.0.156

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

Parse parses rawURL into a URL structure with special handling for file:// URLs

File URLs with relative paths (file://../file, ../file) will be returned as a url.URL object without the Scheme set to "file". This is because the file scheme does not support relative paths. Make sure to check for both "file" or "" (an empty string) in URL.Scheme if you are looking for a file path.

Use the companion function GetURLFilePath() to get a file path suitable for the current operating system.

func ParseOrFatal added in v0.0.38

func ParseOrFatal(l *logrusx.Logger, in string) *url.URL

ParseOrFatal parses a url or fatals.

func ParseOrPanic added in v0.0.38

func ParseOrPanic(in string) *url.URL

ParseOrPanic parses a url or panics.

func ParseRequestURIOrFatal added in v0.0.38

func ParseRequestURIOrFatal(l *logrusx.Logger, in string) *url.URL

ParseRequestURIOrFatal parses a request uri or fatals.

func ParseRequestURIOrPanic added in v0.0.38

func ParseRequestURIOrPanic(in string) *url.URL

ParseRequestURIOrPanic parses a request uri or panics.

func SetQuery added in v0.0.37

func SetQuery(u *url.URL, query url.Values) (ep *url.URL)

SetQuery appends the provided url values to the DSN's query string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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