util

package
v0.2.53 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcatWithUrlEncode

func ConcatWithUrlEncode(param map[string]string) bytes.Buffer

ConcatWithUrlEncode concat the map to form of "k1=v1&k2=v2" and ensure "v1,v2" is Url encoded

func LocalIP

func LocalIP() string

LocalIP 获取机器的IP

func MapStringToStruct

func MapStringToStruct(m map[string]string, i interface{}) error

func ParseResponseMsg

func ParseResponseMsg(resp []byte) (map[string]string, error)

ParseResponseMsg parse the response message in form of "k1=v1&k2=v2" to a map

func PrintMap

func PrintMap(m map[string]string)

PrintMap print map in form of "k=v"

func RandomStr

func RandomStr() string

RandomStr 获取一个随机字符串

func SortAndConcat

func SortAndConcat(param map[string]string) string

SortAndConcat sort the map by key in ASCII order, and concat it in form of "k1=v1&k2=2"

func UrlDecode

func UrlDecode(str string) (string, error)

UrlDecode decode the url encoded string to original string

func UrlEncode

func UrlEncode(str string) string

UrlEncode encode the string for url passing

func XmlToMap

func XmlToMap(xmlData []byte) map[string]string

Types

This section is empty.

Jump to

Keyboard shortcuts

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