common

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Unlicense Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownLoadFilesPost

func DownLoadFilesPost(urlStr string, headMaps map[string]string, data []byte) ([]byte, string, string)

DownLoadFilesPost 下载文件HttpPost

func GetFileHash

func GetFileHash(path string) (hash string)

GetFileHash 计算文件hash

func GetSignByMap

func GetSignByMap(headMap map[string]string, timestamp string, appSecret string) string

GetSignByMap 计算签名参数

func HmacSha256

func HmacSha256(data string, secret []byte) string

HmacSha256 加密算法

func HmacSha256byte

func HmacSha256byte(data string, secret string) []byte

HmacSha256byte 加密算法

func PostWithFormData

func PostWithFormData(method, url string, postData *map[string]string)

func SendPost

func SendPost(urlStr string, headMaps map[string]string, data []byte) ([]byte, string)

SendPost httpPost 请求

func Sha256

func Sha256(src string) string

Sha256 Sha256加密

func SortMapForSign

func SortMapForSign(headMap map[string]string) string

SortMapForSign 将map key进行排序拼接

func UploadFilePost added in v0.3.0

func UploadFilePost(urlStr string, headMaps map[string]string, file []byte, bizContent string, fileName string) ([]byte, string, error)

UploadFilePost 上传即时文件post

Types

type ObjectId

type ObjectId string

func GetGUID

func GetGUID() ObjectId

GetGUID GUID returns a new unique ObjectId. 4byte 时间, 3byte 机器ID 2byte pid 3byte 自增ID

func (ObjectId) Hex

func (id ObjectId) Hex() string

Hex returns a hex representation of the ObjectId. 返回16进制对应的字符串

Jump to

Keyboard shortcuts

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