untils

package
v0.0.0-...-d060b71 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2018 License: MIT Imports: 11 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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 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

Types

This section is empty.

Jump to

Keyboard shortcuts

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