tencentcloud

package
v0.0.0-...-9b96405 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ContentTypeURLEncoded = ContentType("application/x-www-form-urlencoded")
	ContentTypeJSON       = ContentType("application/json; charset=utf-8")
	ContentTypeFormData   = ContentType("multipart/form-data")
)

Variables

This section is empty.

Functions

func HMAC_Sha256

func HMAC_Sha256(key []byte, msg []byte) []byte

Types

type App

type App struct {
	AppID     string
	SecretID  string
	SecretKey string
	Client    fetcher.Client
}

type BaseResponse

type BaseResponse struct {
	Err       *Error `json:"Error"`
	RequestId string
}

func (*BaseResponse) CodeError

func (r *BaseResponse) CodeError() error

func (*BaseResponse) Error

func (r *BaseResponse) Error() string

type ContentType

type ContentType string

type Error

type Error struct {
	Code    string
	Message string
}

type Request

type Request struct {
	Action      string
	Region      string
	Version     string
	URL         *url.URL
	Method      string
	ContentType ContentType
	Header      http.Header
	Body        []byte
	Token       string
	Timestamp   int64
	Service     string
}

func NewRequest

func NewRequest() *Request

func (*Request) CreatePreset

func (r *Request) CreatePreset(a *App, signedHeaders []string) *fetcher.Preset

func (*Request) CreateSignData

func (r *Request) CreateSignData(signed_headers []string) *SignData

func (*Request) MustSetPOSTJSON

func (r *Request) MustSetPOSTJSON(url *url.URL, body interface{})

func (*Request) SetGET

func (r *Request) SetGET(url *url.URL)

func (*Request) SetPOSTFormdata

func (r *Request) SetPOSTFormdata(url *url.URL, body []byte)

type SignData

type SignData struct {
	HTTPRequestMethod    string
	CanonicalURI         string
	CanonicalQueryString string
	CanonicalHeaders     string
	SignedHeaders        string
	HashedRequestPayload string
	Service              string
	Timestamp            int64
}

func (*SignData) Authorization

func (d *SignData) Authorization(secretid string, key string) string

func (*SignData) Date

func (d *SignData) Date() string

func (*SignData) Sign

func (d *SignData) Sign(key string) string

func (*SignData) String

func (d *SignData) String() string

func (*SignData) ToSign

func (d *SignData) ToSign(key string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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