base

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegionCnNorth1    = "cn-north-1"
	RegionUsEast1     = "us-east-1"
	RegionApSingapore = "ap-singapore-1"
)
View Source
const (
	StatementEffectAllow = "Allow"
	StatementEffectDeny  = "Deny"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiInfo

type ApiInfo struct {
	Method  string
	Path    string
	Query   url.Values
	Form    url.Values
	Timeout time.Duration
	Header  http.Header
	Retry   RetrySettings
}

type BaseResp

type BaseResp struct {
	Status      string
	CreatedTime int64
	UpdatedTime int64
}

type CommonResponse

type CommonResponse struct {
	ResponseMetadata ResponseMetadata
	Result           interface{} `json:"Result,omitempty"`
}

Unified JSON return results

type Credentials

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	Service         string
	Region          string
	SessionToken    string
}

func (Credentials) Sign

func (c Credentials) Sign(request *http.Request) *http.Request

func (Credentials) SignUrl

func (c Credentials) SignUrl(request *http.Request) string

type ErrorObj

type ErrorObj struct {
	CodeN   int
	Code    string
	Message string
}

type InnerToken

type InnerToken struct {
	LTAccessKeyId         string
	AccessKeyId           string
	SignedSecretAccessKey string
	ExpiredTime           int64
	PolicyString          string
	Signature             string
}

type MultiPartItem

type MultiPartItem struct {
	// contains filtered or unexported fields
}

func CreateMultiPartItem

func CreateMultiPartItem(header textproto.MIMEHeader, data io.Reader) *MultiPartItem

func CreateMultiPartItemFormField

func CreateMultiPartItemFormField(fieldname string, data string) *MultiPartItem

func CreateMultiPartItemFormFile

func CreateMultiPartItemFormFile(fieldname, filename string, data io.Reader) *MultiPartItem

type Policy

type Policy struct {
	Statement []*Statement
}

type RequestParam

type RequestParam struct {
	IsSignUrl bool
	Body      []byte
	Method    string
	Date      time.Time
	Path      string
	Host      string
	QueryList url.Values
	Headers   http.Header
}

type ResponseMetadata

type ResponseMetadata struct {
	RequestId string
	Service   string    `json:",omitempty"`
	Region    string    `json:",omitempty"`
	Action    string    `json:",omitempty"`
	Version   string    `json:",omitempty"`
	Error     *ErrorObj `json:",omitempty"`
}

type RetrySettings

type RetrySettings struct {
	AutoRetry     bool
	RetryTimes    *uint64
	RetryInterval *time.Duration
}

type SecurityToken2

type SecurityToken2 struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
	ExpiredTime     string
	CurrentTime     string
}

type ServiceInfo

type ServiceInfo struct {
	Timeout     time.Duration
	Scheme      string
	Host        string
	Header      http.Header
	Credentials Credentials
	Retry       RetrySettings
}

type SignRequest

type SignRequest struct {
	XDate          string
	XNotSignBody   string
	XCredential    string
	XAlgorithm     string
	XSignedHeaders string
	XSignedQueries string
	XSignature     string
	XSecurityToken string

	Host           string
	ContentType    string
	XContentSha256 string
	Authorization  string
}

func GetSignRequest

func GetSignRequest(requestParam RequestParam, credentials Credentials) SignRequest

type Statement

type Statement struct {
	Effect    string
	Action    []string
	Resource  []string
	Condition string `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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