Documentation
¶
Index ¶
- Variables
- func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error)
- func TransToString(object interface{}) string
- type Client
- func NewClient() (client *Client, err error)deprecated
- func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error)deprecated
- func NewClientWithBearerToken(regionId, bearerToken string) (client *Client, err error)deprecated
- func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error)deprecated
- func NewClientWithOptions(regionId string, config *Config, credential auth.Credential) (client *Client, err error)
- func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error)
- func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error)deprecated
- func NewClientWithRamRoleArnAndPolicy(regionId string, ...) (client *Client, err error)deprecated
- func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error)deprecated
- func NewClientWithStsRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error)deprecated
- func NewClientWithStsRoleNameOnEcs(regionId string, roleName string) (client *Client, err error)deprecated
- func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error)deprecated
- func (client *Client) AddAsyncTask(task func()) (err error)
- func (client *Client) AppendUserAgent(key, value string)
- func (client *Client) BuildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (err error)
- func (client *Client) CloseLogger()
- func (client *Client) DoAction(request requests.AcsRequest, response responses.AcsResponse) (err error)
- func (client *Client) DoActionWithSigner(request requests.AcsRequest, response responses.AcsResponse, ...) (err error)deprecated
- func (client *Client) EnableAsync(routinePoolSize, maxTaskQueueSize int)
- func (client *Client) GetCloseTrace() bool
- func (client *Client) GetConfig() *Config
- func (client *Client) GetConnectTimeout() time.Duration
- func (client *Client) GetEndpointRules(regionId string, product string) (endpointRaw string, err error)
- func (client *Client) GetHTTPSInsecure() bool
- func (client *Client) GetHttpProxy() string
- func (client *Client) GetHttpsProxy() string
- func (client *Client) GetLogger() *Logger
- func (client *Client) GetLoggerMsg() string
- func (client *Client) GetNoProxy() string
- func (client *Client) GetReadTimeout() time.Duration
- func (client *Client) GetSigner() auth.Signerdeprecated
- func (client *Client) GetTemplate() string
- func (client *Client) GetTracerRootSpan() opentracing.Span
- func (client *Client) Init() (err error)deprecated
- func (client *Client) InitClientConfig() (config *Config)
- func (client *Client) InitWithAccessKey(regionId, accessKeyId, accessKeySecret string) (err error)
- func (client *Client) InitWithBearerToken(regionId, bearerToken string) (err error)
- func (client *Client) InitWithEcsRamRole(regionId, roleName string) (err error)
- func (client *Client) InitWithOptions(regionId string, config *Config, credential auth.Credential) (err error)
- func (client *Client) InitWithProviderChain(regionId string, provider provider.Provider) (err error)
- func (client *Client) InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error)
- func (client *Client) InitWithRamRoleArnAndPolicy(...) (err error)
- func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error)
- func (client *Client) InitWithStsToken(regionId, accessKeyId, accessKeySecret, securityToken string) (err error)
- func (client *Client) OpenLogger()
- func (client *Client) ProcessCommonRequest(request *requests.CommonRequest) (response *responses.CommonResponse, err error)
- func (client *Client) ProcessCommonRequestWithSigner(request *requests.CommonRequest, signerInterface interface{}) (response *responses.CommonResponse, err error)
- func (client *Client) SetCloseTrace(isCloseTrace bool)
- func (client *Client) SetConnectTimeout(connectTimeout time.Duration)
- func (client *Client) SetEndpointRules(endpointMap map[string]string, endpointType string, netWork string)
- func (client *Client) SetHTTPSInsecure(isInsecure bool)
- func (client *Client) SetHttpProxy(httpProxy string)
- func (client *Client) SetHttpsProxy(httpsProxy string)
- func (client *Client) SetLogger(level string, channel string, out io.Writer, template string)
- func (client *Client) SetNoProxy(noProxy string)
- func (client *Client) SetReadTimeout(readTimeout time.Duration)
- func (client *Client) SetSigner(signer auth.Signer)deprecated
- func (client *Client) SetTemplate(template string)
- func (client *Client) SetTracerRootSpan(rootSpan opentracing.Span)
- func (client *Client) SetTransport(transport http.RoundTripper)
- func (client *Client) Shutdown()
- type Config
- func (c *Config) WithAutoRetry(isAutoRetry bool) *Config
- func (c *Config) WithDebug(isDebug bool) *Config
- func (c *Config) WithEnableAsync(isEnableAsync bool) *Config
- func (c *Config) WithGoRoutinePoolSize(goRoutinePoolSize int) *Config
- func (c *Config) WithHttpTransport(httpTransport *http.Transport) *Config
- func (c *Config) WithMaxRetryTime(maxRetryTime int) *Config
- func (c *Config) WithMaxTaskQueueSize(maxTaskQueueSize int) *Config
- func (c *Config) WithScheme(scheme string) *Config
- func (c *Config) WithTimeout(timeout time.Duration) *Config
- func (c *Config) WithUserAgent(userAgent string) *Config
- type Do
- type Logger
Constants ¶
This section is empty.
Variables ¶
var DefaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), Version)
var Version = "0.0.1"
Version this value will be replaced while build: -ldflags="-X sdk.version=x.x.x"
Functions ¶
func TransToString ¶
func TransToString(object interface{}) string
Types ¶
type Client ¶
type Client struct { SourceIp string SecureTransport string EndpointMap map[string]string EndpointType string Network string Domain string // contains filtered or unexported fields }
Client the type Client
func NewClientWithAccessKey
deprecated
func NewClientWithBearerToken
deprecated
func NewClientWithEcsRamRole
deprecated
func NewClientWithOptions ¶
func NewClientWithOptions(regionId string, config *Config, credential auth.Credential) (client *Client, err error)
Usage: ```go credentialsProvider := credentials.NewStaticAKCredentialsProvider(accessKeyId, accessKeySecret) sdk.NewClientWithOptions(regionId, config, credentialsProvider) ``` More credentials provider, see: github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials - StaticAKCredentialsProvider - StaticSTSCredentialsProvider - BearerTokenCredentialsProvider - RAMRoleARNCredentialsProvider - ECSRAMRoleCredentialsProvider - OIDCCredentialsProvider
func NewClientWithProvider ¶
func NewClientWithRamRoleArn
deprecated
func NewClientWithRamRoleArnAndPolicy
deprecated
func NewClientWithStsRoleArn
deprecated
func NewClientWithStsRoleNameOnEcs
deprecated
func NewClientWithStsToken
deprecated
func (*Client) AddAsyncTask ¶
* only block when any one of the following occurs: * 1. the asyncTaskQueue is full, increase the queue size to avoid this * 2. Shutdown() in progressing, the client is being closed
func (*Client) AppendUserAgent ¶
func (*Client) BuildRequestWithSigner ¶
func (*Client) CloseLogger ¶
func (client *Client) CloseLogger()
func (*Client) DoAction ¶
func (client *Client) DoAction(request requests.AcsRequest, response responses.AcsResponse) (err error)
func (*Client) DoActionWithSigner
deprecated
func (client *Client) DoActionWithSigner(request requests.AcsRequest, response responses.AcsResponse, signer auth.Signer) (err error)
Deprecated: don't use it
func (*Client) EnableAsync ¶
EnableAsync enable the async task queue
func (*Client) GetCloseTrace ¶ added in v1.62.0
func (*Client) GetConnectTimeout ¶
func (*Client) GetEndpointRules ¶
func (*Client) GetHTTPSInsecure ¶
func (*Client) GetHttpProxy ¶
func (*Client) GetHttpsProxy ¶
func (*Client) GetLoggerMsg ¶
func (*Client) GetNoProxy ¶
func (*Client) GetReadTimeout ¶
func (*Client) GetTemplate ¶
func (*Client) GetTracerRootSpan ¶ added in v1.62.0
func (client *Client) GetTracerRootSpan() opentracing.Span
func (*Client) InitClientConfig ¶
func (*Client) InitWithAccessKey ¶
func (*Client) InitWithBearerToken ¶
func (*Client) InitWithEcsRamRole ¶
func (*Client) InitWithOptions ¶
func (*Client) InitWithProviderChain ¶
func (client *Client) InitWithProviderChain(regionId string, provider provider.Provider) (err error)
InitWithProviderChain will get credential from the providerChain, the RsaKeyPairCredential Only applicable to regionID `ap-northeast-1`, if your providerChain may return a credential type with RsaKeyPairCredential, please ensure your regionID is `ap-northeast-1`.
func (*Client) InitWithRamRoleArn ¶
func (*Client) InitWithRamRoleArnAndPolicy ¶
func (*Client) InitWithRsaKeyPair ¶
func (*Client) InitWithStsToken ¶
func (*Client) OpenLogger ¶
func (client *Client) OpenLogger()
func (*Client) ProcessCommonRequest ¶
func (client *Client) ProcessCommonRequest(request *requests.CommonRequest) (response *responses.CommonResponse, err error)
func (*Client) ProcessCommonRequestWithSigner ¶
func (client *Client) ProcessCommonRequestWithSigner(request *requests.CommonRequest, signerInterface interface{}) (response *responses.CommonResponse, err error)
func (*Client) SetCloseTrace ¶ added in v1.62.0
func (*Client) SetConnectTimeout ¶
func (*Client) SetEndpointRules ¶
func (*Client) SetHTTPSInsecure ¶
func (*Client) SetHttpProxy ¶
func (*Client) SetHttpsProxy ¶
func (*Client) SetNoProxy ¶
func (*Client) SetReadTimeout ¶
func (*Client) SetTemplate ¶
func (*Client) SetTracerRootSpan ¶ added in v1.62.0
func (client *Client) SetTracerRootSpan(rootSpan opentracing.Span)
func (*Client) SetTransport ¶ added in v1.60.349
func (client *Client) SetTransport(transport http.RoundTripper)
type Config ¶
type Config struct { AutoRetry bool MaxRetryTime int UserAgent string Debug bool HttpTransport *http.Transport Transport http.RoundTripper EnableAsync bool MaxTaskQueueSize int GoRoutinePoolSize int Scheme string Timeout time.Duration }
func (*Config) WithAutoRetry ¶
func (*Config) WithEnableAsync ¶
func (*Config) WithGoRoutinePoolSize ¶
func (*Config) WithHttpTransport ¶
func (*Config) WithMaxRetryTime ¶
func (*Config) WithMaxTaskQueueSize ¶
func (*Config) WithScheme ¶
func (*Config) WithUserAgent ¶
Directories
¶
Path | Synopsis |
---|---|
credentials/providers
Package providers Deprecated
|
Package providers Deprecated |
* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |