untils

package
v0.0.0-...-40d7e56 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiKeyGet

func ApiKeyGet(mapParams map[string]string, strRequestPath string) string

进行签名后的HTTP GET请求, 参考官方Python Demo写的 mapParams: map类型的请求参数, key:value strRequest: API路由路径 return: 请求结果

func ApiKeyPost

func ApiKeyPost(mapParams map[string]string, strRequestPath string) string

进行签名后的HTTP POST请求, 参考官方Python Demo写的 mapParams: map类型的请求参数, key:value strRequest: API路由路径 return: 请求结果

func ComputeHmac256

func ComputeHmac256(strMessage string, strSecret string) string

HMAC SHA256加密 strMessage: 需要加密的信息 strSecret: 密钥 return: BASE64编码的密文

func CreatePrivateSignByJWT

func CreatePrivateSignByJWT(sign string) (string, error)

func CreateSign

func CreateSign(mapParams map[string]string, strMethod, strHostUrl, strRequestPath, strSecretKey string) string

构造签名 mapParams: 送进来参与签名的参数, Map类型 strMethod: 请求的方法 GET, POST...... strHostUrl: 请求的主机 strRequestPath: 请求的路由路径 strSecretKey: 进行签名的密钥

func HttpGetRequest

func HttpGetRequest(strUrl string, mapParams map[string]string) string

Http Get请求基础函数, 通过封装Go语言Http请求, 支持火币网REST API的HTTP Get请求 strUrl: 请求的URL strParams: string类型的请求参数, user=lxz&pwd=lxz return: 请求结果

func HttpPostRequest

func HttpPostRequest(strUrl string, mapParams map[string]string) string

Http POST请求基础函数, 通过封装Go语言Http请求, 支持火币网REST API的HTTP POST请求 strUrl: 请求的URL mapParams: map类型的请求参数 return: 请求结果

func Map2UrlQuery

func Map2UrlQuery(mapParams map[string]string) string

将map格式的请求参数转换为字符串格式的 mapParams: map格式的参数键值对 return: 查询字符串

func Map2UrlQueryBySort

func Map2UrlQueryBySort(mapParams map[string]string) string

将map格式的请求参数转换为字符串格式的,并按照Map的key升序排列 mapParams: map格式的参数键值对 return: 查询字符串

func MapSortByKey

func MapSortByKey(mapValue map[string]string) map[string]string

对Map按着ASCII码进行排序 mapValue: 需要进行排序的map return: 排序后的map

func MapValueEncodeURI

func MapValueEncodeURI(mapValue map[string]string) map[string]string

对Map的值进行URI编码 mapParams: 需要进行URI编码的map return: 编码后的map

func SignByJWT

func SignByJWT(pem string, data string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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