sdk

package
v1.63.63 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 26 Imported by: 1,036

Documentation

Index

Constants

View Source
const Version = "1.63.22"

Follow the latest version

Variables

View Source
var DefaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), Version)

Functions

func Timeout

func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error)

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 NewClient deprecated

func NewClient() (client *Client, err error)

Deprecated: don't use it

func NewClientWithAccessKey deprecated

func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error)

Deprecated: use NewClientWithOptions(regionId, config, credentialsProvider) instead of

func NewClientWithBearerToken deprecated

func NewClientWithBearerToken(regionId, bearerToken string) (client *Client, err error)

Deprecated: use NewClientWithOptions(regionId, config, credentialsProvider) instead of

func NewClientWithEcsRamRole deprecated

func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error)

Deprecated: use NewClientWithOptions(regionId, config, credentialsProvider) instead of

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 NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error)

func NewClientWithRamRoleArn deprecated

func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error)

Deprecated: use NewClientWithOptions(regionId, config, credentialsProvider) instead of

func NewClientWithRamRoleArnAndPolicy deprecated

func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error)

Deprecated: use NewClientWithOptions(regionId, config, credentialsProvider) instead of

func NewClientWithRsaKeyPair deprecated

func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error)

Deprecated: the RsaKeyPair is deprecated

func NewClientWithStsRoleArn deprecated

func NewClientWithStsRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error)

Deprecated: Use NewClientWithRamRoleArn in this package instead.

func NewClientWithStsRoleNameOnEcs deprecated

func NewClientWithStsRoleNameOnEcs(regionId string, roleName string) (client *Client, err error)

Deprecated: Use NewClientWithEcsRamRole in this package instead.

func NewClientWithStsToken deprecated

func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error)

Deprecated: use NewClientWithOptions(regionId, config, credentialsProvider) instead of

func (*Client) AddAsyncTask

func (client *Client) AddAsyncTask(task func()) (err error)

* 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 *Client) AppendUserAgent(key, value string)

func (*Client) BuildRequestWithSigner

func (client *Client) BuildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (err error)

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

func (client *Client) EnableAsync(routinePoolSize, maxTaskQueueSize int)

EnableAsync enable the async task queue

func (*Client) GetCloseTrace added in v1.62.0

func (client *Client) GetCloseTrace() bool

func (*Client) GetConfig

func (client *Client) GetConfig() *Config

func (*Client) GetConnectTimeout

func (client *Client) GetConnectTimeout() time.Duration

func (*Client) GetEndpointRules

func (client *Client) GetEndpointRules(regionId string, product string) (endpointRaw string, err error)

func (*Client) GetHTTPSInsecure

func (client *Client) GetHTTPSInsecure() bool

func (*Client) GetHttpProxy

func (client *Client) GetHttpProxy() string

func (*Client) GetHttpsProxy

func (client *Client) GetHttpsProxy() string

func (*Client) GetLogger

func (client *Client) GetLogger() *Logger

func (*Client) GetLoggerMsg

func (client *Client) GetLoggerMsg() string

func (*Client) GetNoProxy

func (client *Client) GetNoProxy() string

func (*Client) GetReadTimeout

func (client *Client) GetReadTimeout() time.Duration

func (*Client) GetSigner deprecated added in v1.61.57

func (client *Client) GetSigner() auth.Signer

Deprecated: don't use it

func (*Client) GetTemplate

func (client *Client) GetTemplate() string

func (*Client) GetTracerRootSpan added in v1.62.0

func (client *Client) GetTracerRootSpan() opentracing.Span

func (*Client) Init deprecated

func (client *Client) Init() (err error)

Deprecated: don't use it

func (*Client) InitClientConfig

func (client *Client) InitClientConfig() (config *Config)

func (*Client) InitWithAccessKey

func (client *Client) InitWithAccessKey(regionId, accessKeyId, accessKeySecret string) (err error)

func (*Client) InitWithBearerToken

func (client *Client) InitWithBearerToken(regionId, bearerToken string) (err error)

func (*Client) InitWithEcsRamRole

func (client *Client) InitWithEcsRamRole(regionId, roleName string) (err error)

func (*Client) InitWithOptions

func (client *Client) InitWithOptions(regionId string, config *Config, credential auth.Credential) (err error)

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 *Client) InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error)

func (*Client) InitWithRamRoleArnAndPolicy

func (client *Client) InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (err error)

func (*Client) InitWithRsaKeyPair

func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error)

func (*Client) InitWithStsToken

func (client *Client) InitWithStsToken(regionId, accessKeyId, accessKeySecret, securityToken string) (err error)

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 *Client) SetCloseTrace(isCloseTrace bool)

func (*Client) SetConnectTimeout

func (client *Client) SetConnectTimeout(connectTimeout time.Duration)

func (*Client) SetEndpointRules

func (client *Client) SetEndpointRules(endpointMap map[string]string, endpointType string, netWork string)

func (*Client) SetHTTPSInsecure

func (client *Client) SetHTTPSInsecure(isInsecure bool)

func (*Client) SetHttpProxy

func (client *Client) SetHttpProxy(httpProxy string)

func (*Client) SetHttpsProxy

func (client *Client) SetHttpsProxy(httpsProxy string)

func (*Client) SetLogger

func (client *Client) SetLogger(level string, channel string, out io.Writer, template string)

func (*Client) SetNoProxy

func (client *Client) SetNoProxy(noProxy string)

func (*Client) SetReadTimeout

func (client *Client) SetReadTimeout(readTimeout time.Duration)

func (*Client) SetSigner deprecated added in v1.61.57

func (client *Client) SetSigner(signer auth.Signer)

Deprecated: don't use it

func (*Client) SetTemplate

func (client *Client) SetTemplate(template string)

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)

func (*Client) Shutdown

func (client *Client) Shutdown()

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 NewConfig

func NewConfig() (config *Config)

func (*Config) WithAutoRetry

func (c *Config) WithAutoRetry(isAutoRetry bool) *Config

func (*Config) WithDebug

func (c *Config) WithDebug(isDebug bool) *Config

func (*Config) WithEnableAsync

func (c *Config) WithEnableAsync(isEnableAsync bool) *Config

func (*Config) WithGoRoutinePoolSize

func (c *Config) WithGoRoutinePoolSize(goRoutinePoolSize int) *Config

func (*Config) WithHttpTransport

func (c *Config) WithHttpTransport(httpTransport *http.Transport) *Config

func (*Config) WithMaxRetryTime

func (c *Config) WithMaxRetryTime(maxRetryTime int) *Config

func (*Config) WithMaxTaskQueueSize

func (c *Config) WithMaxTaskQueueSize(maxTaskQueueSize int) *Config

func (*Config) WithScheme

func (c *Config) WithScheme(scheme string) *Config

func (*Config) WithTimeout

func (c *Config) WithTimeout(timeout time.Duration) *Config

func (*Config) WithUserAgent

func (c *Config) WithUserAgent(userAgent string) *Config

type Do added in v1.62.809

type Do func(req *http.Request) (*http.Response, error)

type Logger

type Logger struct {
	*log.Logger
	// contains filtered or unexported fields
}

Directories

Path Synopsis
credentials/providers
Package providers Deprecated
Package providers Deprecated
The utils package just degisned for github.com/aliyun/alibaba-clouc-sdk-go/sdk inner.
The utils package just degisned for github.com/aliyun/alibaba-clouc-sdk-go/sdk inner.

Jump to

Keyboard shortcuts

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