url

package
Version: v0.0.0-...-4eec5e9 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2015 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Escape

func Escape(s string) string

func EscapeEx

func EscapeEx(s string, mode Encoding) string

func QueryEscape

func QueryEscape(s string) string

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

func QueryUnescape

func QueryUnescape(s string) (string, error)

QueryUnescape does the inverse transformation of QueryEscape, converting %AB into the byte 0xAB and '+' into ' ' (space). It returns an error if any % is not followed by two hexadecimal digits.

func Unescape

func Unescape(s string) (string, error)

func UnescapeEx

func UnescapeEx(s string, mode Encoding) (string, error)

UnescapeEx unescapes a string; the mode specifies which section of the URL string is being unescaped.

Types

type Encoding

type Encoding int
const (
	EncodePath Encoding = 1 + iota
	EncodeUserPassword
	EncodeQueryComponent
	EncodeFragment
)

type EscapeError

type EscapeError string

func (EscapeError) Error

func (e EscapeError) Error() string

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL