Documentation ¶
Index ¶
- Constants
- func AuthHeaderValue(signature, accessKey string, signedHeaders []string) string
- func CanonicalHeaders(r *DefaultHttpRequest, signerHeaders []string) string
- func CanonicalQueryString(r *DefaultHttpRequest) string
- func CanonicalRequest(r *DefaultHttpRequest, signedHeaders []string) (string, error)
- func CanonicalURI(r *DefaultHttpRequest) string
- func HexEncodeSHA256Hash(body []byte) (string, error)
- func Sign(r *DefaultHttpRequest, ak string, sk string) (map[string]string, error)
- func SignStringToSign(stringToSign string, signingKey []byte) (string, error)
- func SignedHeaders(headers map[string]string) []string
- func StringToSign(canonicalRequest string, t time.Time) (string, error)
- type DefaultHttpRequest
- func (httpRequest *DefaultHttpRequest) CanonicalMapQueryParams(key string, value reflect.Value) []map[string]string
- func (httpRequest *DefaultHttpRequest) CanonicalSliceQueryParamsToMulti(value reflect.Value) []string
- func (httpRequest *DefaultHttpRequest) DoGetRequest(auth, timestamp string) ([]byte, error)
- func (r *DefaultHttpRequest) GetUserId(accesskey, secretkey string) (string, error)
- func (r *DefaultHttpRequest) GetUserName(accesskey, secretkey string) (string, error)
- type Driver
Constants ¶
View Source
const ( BasicDateFormat = "20060102T150405Z" Algorithm = "SDK-HMAC-SHA256" HeaderXDate = "X-Sdk-Date" HeaderHost = "host" HeaderAuthorization = "Authorization" HeaderContentSha256 = "X-Sdk-Content-Sha256" )
Variables ¶
This section is empty.
Functions ¶
func AuthHeaderValue ¶
Get the finalized value for the "Authorization" header. The signature parameter is the output from SignStringToSign
func CanonicalHeaders ¶
func CanonicalHeaders(r *DefaultHttpRequest, signerHeaders []string) string
CanonicalHeaders
func CanonicalQueryString ¶
func CanonicalQueryString(r *DefaultHttpRequest) string
CanonicalQueryString
func CanonicalRequest ¶
func CanonicalRequest(r *DefaultHttpRequest, signedHeaders []string) (string, error)
func CanonicalURI ¶
func CanonicalURI(r *DefaultHttpRequest) string
CanonicalURI returns request uri
func HexEncodeSHA256Hash ¶
HexEncodeSHA256Hash returns hexcode of sha256
func SignStringToSign ¶
Create the HWS Signature.
Types ¶
type DefaultHttpRequest ¶
type DefaultHttpRequest struct { Endpoint string Path string Method string QueryParams map[string]interface{} // pathParams map[string]string HeaderParams map[string]string // formParams map[string]def.FormData Body []byte }
func NewGetRequest ¶
func NewGetRequest(region string) *DefaultHttpRequest
func (*DefaultHttpRequest) CanonicalMapQueryParams ¶
func (*DefaultHttpRequest) CanonicalSliceQueryParamsToMulti ¶
func (httpRequest *DefaultHttpRequest) CanonicalSliceQueryParamsToMulti(value reflect.Value) []string
func (*DefaultHttpRequest) DoGetRequest ¶
func (httpRequest *DefaultHttpRequest) DoGetRequest(auth, timestamp string) ([]byte, error)
func (*DefaultHttpRequest) GetUserId ¶
func (r *DefaultHttpRequest) GetUserId(accesskey, secretkey string) (string, error)
func (*DefaultHttpRequest) GetUserName ¶
func (r *DefaultHttpRequest) GetUserName(accesskey, secretkey string) (string, error)
Click to show internal directories.
Click to hide internal directories.