Version: v2.1.4 Latest Latest

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 3 Imported by: 5



Package gurl provides useful API for URL handling.



This section is empty.


This section is empty.


func BuildQuery

func BuildQuery(queryData url.Values) string

BuildQuery Generate URL-encoded query string. See

func Decode

func Decode(str string) (string, error)

Decode does the inverse transformation of Encode, converting each 3-byte encoded substring of the form "%AB" into the hex-decoded byte 0xAB. It returns an error if any % is not followed by two hexadecimal digits.

func Encode

func Encode(str string) string

Encode escapes the string so it can be safely placed inside a URL query.

func ParseURL

func ParseURL(str string, component int) (map[string]string, error)

ParseURL Parse a URL and return its components. -1: all; 1: scheme; 2: host; 4: port; 8: user; 16: pass; 32: path; 64: query; 128: fragment. See

func RawDecode

func RawDecode(str string) (string, error)

RawDecode does decode the given string Decode URL-encoded strings. See

func RawEncode

func RawEncode(str string) string

RawEncode does encode the given string according URL-encode according to RFC 3986. See


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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