common

package
v0.0.0-...-e06075d Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Signature

func Signature(sig *SignatureData) (string, error)

Signature ... sig data: [Parameter Message] + [Request Path] + [Request Method] + [timestamp] where: Parameter Message is the data being sent to your API. Request Path is an identifier that your API will use to recognise the service (remember that this won’t say who the service is acting on behalf of). Request Method is GET/POST etc. Timestamp corresponds to when the request was made.

Types

type SignatureData

type SignatureData struct {
	Secret        string // 签名秘钥
	Signature     string // 签名字符串
	Message       string // 字符串
	SignAlgo      string // HMAC-MD5, HMAC-SHA256
	RequestPath   string // 请求路径
	RequestMethod string // 请求方法
	Timestamp     int64  // 签名时间戳
}

SignatureData ...

Jump to

Keyboard shortcuts

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