Documentation ¶
Index ¶
- Constants
- func AuthHeaderValue(signature, accessKey string, signedHeaders []string) string
- func CanonicalHeaders(r *http.Request, signerHeaders []string) string
- func CanonicalQueryString(r *http.Request) string
- func CanonicalRequest(r *http.Request, signedHeaders []string) (string, error)
- func CanonicalURI(r *http.Request) string
- func HexEncodeSHA256Hash(body []byte) (string, error)
- func RequestPayload(r *http.Request) ([]byte, error)
- func SignStringToSign(stringToSign string, signingKey []byte) (string, error)
- func SignedHeaders(r *http.Request) []string
- func StringToSign(canonicalRequest string, t time.Time) string
- type AccessService
- func (accessService *AccessService) Delete(url string, body string) (*http.Response, error)
- func (accessService *AccessService) Get(url string) (*http.Response, error)
- func (accessService *AccessService) Post(url string, header map[string]string, body io.Reader) (*http.Response, error)
- func (accessService *AccessService) Put(url string, body string) (*http.Response, error)
- type Signer
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 ¶
CanonicalHeaders
func CanonicalRequest ¶
Build a CanonicalRequest from a regular request string
CanonicalRequest =
HTTPRequestMethod + '\n' + CanonicalURI + '\n' + CanonicalQueryString + '\n' + CanonicalHeaders + '\n' + SignedHeaders + '\n' + HexEncode(Hash(RequestPayload))
func HexEncodeSHA256Hash ¶
HexEncodeSHA256Hash returns hexcode of sha256
func SignStringToSign ¶
Create the HWS Signature.
Types ¶
type AccessService ¶
type AccessService struct {
// contains filtered or unexported fields
}
func NewAccessService ¶
func NewAccessService(authInfo *param.AuthInfo) *AccessService
func NewAccessServiceWithProxy ¶
func NewAccessServiceWithProxy(authInfo *param.AuthInfo, proxyHostInfo *param.ProxyHostInfo) *AccessService
func (*AccessService) Get ¶
func (accessService *AccessService) Get(url string) (*http.Response, error)
Click to show internal directories.
Click to hide internal directories.