signature

package
v1.4.18 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessKey string = "a0817987-f3e0-459e-cb09-bdb7d91d6c0e"
	Secret    string = "bae8be05-26cc-6a4d-7fa9-7f81729a9541"
	Version   string = "CAF1"
	Algorithm string = "HMAC-SHA256"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestHeaders

type RequestHeaders struct {
	Key   string // 头键名
	Value string // 头键值
}

请求头结构体

type RequestParams

type RequestParams struct {
	Key   string // 参数键名
	Value string // 参数键值
}

请求参数结构体

type RequestSignature

type RequestSignature struct {
	Method  string           // 请求方法
	Uri     string           // 请求URI
	Params  []RequestParams  // 请求参数, 按照键名排序
	Headers []RequestHeaders // 请求头, 按照键名排序
	Body    []byte           // 请求体

	AccessKey string // 访问密钥
	Secret    string // 密钥

	Version   string // 版本号
	Algorithm string // 算法
}

请求签名结构体

func NewDefaultRequestSignature

func NewDefaultRequestSignature(method string, uri string, params []RequestParams, headers []RequestHeaders, body []byte) *RequestSignature

创建请求签名对象

func (*RequestSignature) GenAuthorization

func (r *RequestSignature) GenAuthorization() string

生成签名授权字符串

Jump to

Keyboard shortcuts

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