Documentation ¶
Index ¶
- Constants
- func Sign4(request *http.Request, credential Credentials) *http.Request
- type ApiInfo
- type BaseResp
- type Client
- func (client *Client) GetSignUrl(api string, query url.Values) (string, error)
- func (client *Client) Json(api string, query url.Values, body string) ([]byte, int, error)
- func (client *Client) Post(api string, query url.Values, form url.Values) ([]byte, int, error)
- func (client *Client) PostWithContentType(api string, query url.Values, body string, ct string) ([]byte, int, error)
- func (client *Client) Query(api string, query url.Values) ([]byte, int, error)
- func (client *Client) SetAccessKey(ak string)
- func (client *Client) SetCredential(c Credentials)
- func (client *Client) SetHost(host string)
- func (client *Client) SetScheme(scheme string)
- func (client *Client) SetSecretKey(sk string)
- func (client *Client) SetSessionToken(token string)
- func (client *Client) SetTimeout(timeout time.Duration)
- func (client *Client) SignSts2(inlinePolicy *Policy, expire time.Duration) (*SecurityToken2, error)
- type CommonResponse
- type Credentials
- type ErrorObj
- type InnerToken
- type Policy
- type ResponseMetadata
- type SecurityToken2
- type ServiceInfo
- type Statement
Constants ¶
View Source
const ( RegionUsEast1 = "us-east-1" RegionApSingapore = "ap-singapore-1" )
View Source
const ( StatementEffectAllow = "Allow" StatementEffectDeny = "Deny" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Client http.Client SdkVersion string ServiceInfo *ServiceInfo ApiInfoList map[string]*ApiInfo }
Client 基础客户端
func NewClient ¶
func NewClient(info *ServiceInfo, apiInfoList map[string]*ApiInfo) *Client
NewClient 生成一个客户端
func (*Client) GetSignUrl ¶
GetSignUrl 获取签名字符串
func (*Client) PostWithContentType ¶
func (client *Client) PostWithContentType(api string, query url.Values, body string, ct string) ([]byte, int, error)
PostWithContentType 发起自定义 Content-Type 的 post 请求,Content-Type 不可以为空
func (*Client) SetCredential ¶
func (client *Client) SetCredential(c Credentials)
SetCredential 设置Credentials
func (*Client) SetSessionToken ¶
SetSessionToken
func (*Client) SetTimeout ¶
type CommonResponse ¶
type CommonResponse struct { ResponseMetadata ResponseMetadata Result interface{} `json:"Result,omitempty"` }
统一的JSON返回结果
type Credentials ¶
type Credentials struct { AccessKeyID string SecretAccessKey string Service string Region string SessionToken string }
func (Credentials) Clone ¶
func (cred Credentials) Clone() Credentials
type InnerToken ¶
type ResponseMetadata ¶
type SecurityToken2 ¶
type ServiceInfo ¶
type ServiceInfo struct { Timeout time.Duration Scheme string Host string Header http.Header Credentials Credentials }
func (*ServiceInfo) Clone ¶
func (serviceInfo *ServiceInfo) Clone() *ServiceInfo
type Statement ¶
type Statement struct { Effect string Action []string Resource []string Condition string `json:",omitempty"` }
func NewAllowStatement ¶
func NewDenyStatement ¶
Click to show internal directories.
Click to hide internal directories.