url

package
v0.0.0-...-a69649c Latest Latest
Warning

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

Go to latest
Published: May 26, 2014 License: GPL-2.0 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

Jump to

Keyboard shortcuts

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