Documentation ¶
Index ¶
- type Credentials
- func (ath *Credentials) NewSignParams(action string, version, timestamp string) map[string]string
- func (ath *Credentials) Sign(action string, version string, timestamp int64) (signature string)
- func (ath *Credentials) Sign2(action string, version, timestamp string) (queryString, signature string)
- func (ath *Credentials) SignExt(queryParams map[string]string) (queryString, signature string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
Credentials 鉴权类,用于生成请求签名签名 https://developer.danghongyun.com/rest_api_new.html 文档
func (*Credentials) NewSignParams ¶
func (ath *Credentials) NewSignParams(action string, version, timestamp string) map[string]string
NewSignParams new signparmas
func (*Credentials) Sign ¶
func (ath *Credentials) Sign(action string, version string, timestamp int64) (signature string)
Sign 生成签名 action: action version: version timestamp: timestamp 毫秒 signature:请求签名,签名生成规则:对所有参数按照名称排序(CASE_INSENSITIVE_ORDER)生成一个字符串,并在字符串头上加上accessSecret,然后对该字符串调用[HmacSHA256](http://en.wikipedia.org/wiki/Hash-based_message_authentication_code) 算法生成signature。 每一个API,根据输入参数的不同,生成的签名都是不同的。
Click to show internal directories.
Click to hide internal directories.