Documentation
¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func Float64(v float64) *float64
- func GetUrlQueriesEncoded(params map[string]string) string
- func InitStructWithDefaultTag(bean interface{})
- func Int64(v int64) *int64
- func Integer(v int) *int
- func NewZenlayerCloudSdkError(code, message, requestId string) error
- func ParseFromHttpResponse(hr *http.Response, response Response) (err error)
- func String(v string) *string
- func ToBool(v *bool) bool
- func ToFloat64(v *float64) float64
- func ToInt64(v *int64) int64
- func ToInteger(v *int) int
- func ToString(v *string) string
- func ToUint(v *uint) uint
- func ToUint64(v *uint64) uint64
- func Uint(v uint) *uint
- func Uint64(v uint64) *uint64
- type BaseRequest
- func (br *BaseRequest) GetAction() string
- func (br *BaseRequest) GetApiVersion() string
- func (br *BaseRequest) GetAutoRetries() bool
- func (br *BaseRequest) GetBody() []byte
- func (br *BaseRequest) GetBodyReader() io.Reader
- func (br *BaseRequest) GetBodyStr() string
- func (br *BaseRequest) GetContentType() string
- func (br *BaseRequest) GetDomain() string
- func (br *BaseRequest) GetFormParams() map[string]string
- func (br *BaseRequest) GetHeaders() map[string]string
- func (br *BaseRequest) GetHttpMethod() string
- func (br *BaseRequest) GetMaxAttempts() int
- func (br *BaseRequest) GetParams() map[string]string
- func (br *BaseRequest) GetPath() string
- func (br *BaseRequest) GetScheme() string
- func (br *BaseRequest) GetServiceName() string
- func (br *BaseRequest) GetUrl() string
- func (br *BaseRequest) Init() *BaseRequest
- func (br *BaseRequest) InitWithApiInfo(serviceName, apiVersion, action string)
- func (br *BaseRequest) SetAutoRetries(autoRetires bool)
- func (br *BaseRequest) SetBody(body []byte)
- func (br *BaseRequest) SetContentType(contentType string)
- func (br *BaseRequest) SetDomain(domain string)
- func (br *BaseRequest) SetHeaders(headers map[string]string)
- func (br *BaseRequest) SetMaxAttempts(maxAttempts int)
- func (br *BaseRequest) SetPath(path string)
- func (br *BaseRequest) SetScheme(scheme string)
- func (br *BaseRequest) SetServiceName(serviceName string)
- type BaseResponse
- type Client
- type Config
- type Credential
- type CredentialIface
- type ErrorResponse
- type Request
- type Response
- type ZenlayerCloudSdkError
Constants ¶
View Source
const ( JsonParseError = "JSON_PARSE_FAILED" NetworkError = "NETWORK_ERROR" CredentialMissingError = "CREDENTIAL_VALUE_MISSING" IoError = "IO_ERROR" )
View Source
const ( POST = "POST" GET = "GET" HTTP = "http" HTTPS = "https" DOMAIN = "console.zenlayer.com" )
View Source
const SdkLang = "go"
Variables ¶
This section is empty.
Functions ¶
func GetUrlQueriesEncoded ¶
func InitStructWithDefaultTag ¶
func InitStructWithDefaultTag(bean interface{})
func ParseFromHttpResponse ¶
Types ¶
type BaseRequest ¶
type BaseRequest struct {
// contains filtered or unexported fields
}
func (*BaseRequest) GetAction ¶
func (br *BaseRequest) GetAction() string
func (*BaseRequest) GetApiVersion ¶
func (br *BaseRequest) GetApiVersion() string
func (*BaseRequest) GetAutoRetries ¶
func (br *BaseRequest) GetAutoRetries() bool
func (*BaseRequest) GetBody ¶
func (br *BaseRequest) GetBody() []byte
func (*BaseRequest) GetBodyReader ¶
func (br *BaseRequest) GetBodyReader() io.Reader
func (*BaseRequest) GetBodyStr ¶
func (br *BaseRequest) GetBodyStr() string
func (*BaseRequest) GetContentType ¶
func (br *BaseRequest) GetContentType() string
func (*BaseRequest) GetDomain ¶
func (br *BaseRequest) GetDomain() string
func (*BaseRequest) GetFormParams ¶
func (br *BaseRequest) GetFormParams() map[string]string
func (*BaseRequest) GetHeaders ¶
func (br *BaseRequest) GetHeaders() map[string]string
func (*BaseRequest) GetHttpMethod ¶
func (br *BaseRequest) GetHttpMethod() string
func (*BaseRequest) GetMaxAttempts ¶
func (br *BaseRequest) GetMaxAttempts() int
func (*BaseRequest) GetParams ¶
func (br *BaseRequest) GetParams() map[string]string
func (*BaseRequest) GetPath ¶
func (br *BaseRequest) GetPath() string
func (*BaseRequest) GetScheme ¶
func (br *BaseRequest) GetScheme() string
func (*BaseRequest) GetServiceName ¶
func (br *BaseRequest) GetServiceName() string
func (*BaseRequest) GetUrl ¶
func (br *BaseRequest) GetUrl() string
func (*BaseRequest) Init ¶
func (br *BaseRequest) Init() *BaseRequest
func (*BaseRequest) InitWithApiInfo ¶
func (br *BaseRequest) InitWithApiInfo(serviceName, apiVersion, action string)
func (*BaseRequest) SetAutoRetries ¶
func (br *BaseRequest) SetAutoRetries(autoRetires bool)
func (*BaseRequest) SetBody ¶
func (br *BaseRequest) SetBody(body []byte)
func (*BaseRequest) SetContentType ¶
func (br *BaseRequest) SetContentType(contentType string)
func (*BaseRequest) SetDomain ¶
func (br *BaseRequest) SetDomain(domain string)
func (*BaseRequest) SetHeaders ¶
func (br *BaseRequest) SetHeaders(headers map[string]string)
func (*BaseRequest) SetMaxAttempts ¶
func (br *BaseRequest) SetMaxAttempts(maxAttempts int)
func (*BaseRequest) SetPath ¶
func (br *BaseRequest) SetPath(path string)
func (*BaseRequest) SetScheme ¶
func (br *BaseRequest) SetScheme(scheme string)
func (*BaseRequest) SetServiceName ¶
func (br *BaseRequest) SetServiceName(serviceName string)
type BaseResponse ¶
type BaseResponse struct {
}
func (*BaseResponse) ParseErrorResponse ¶
func (r *BaseResponse) ParseErrorResponse(body []byte) (err error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) InitWithCredential ¶
func (c *Client) InitWithCredential(credential *Credential) (err error)
func (*Client) WithConfig ¶
func (*Client) WithRequestClient ¶ added in v0.1.3
type Config ¶
type Config struct {
AutoRetry bool `default:"false"`
MaxRetryTime int `default:"3"`
RetryDuration time.Duration
HttpTransport *http.Transport `default:""`
Transport http.RoundTripper `default:""`
Proxy string `default:""`
Scheme string `default:"HTTPS"`
Domain string `default:""`
// timeout in seconds
Timeout int `default:"300"`
Debug *bool
}
func (*Config) WithAutoRetry ¶
func (*Config) WithHttpTransport ¶
func (*Config) WithMaxRetryTime ¶
func (*Config) WithScheme ¶
func (*Config) WithTimeout ¶
type Credential ¶
func NewCredential ¶
func NewCredential(secretKeyId, secretKeyPassword string) *Credential
func (*Credential) GetSecretKeyId ¶
func (c *Credential) GetSecretKeyId() string
func (*Credential) GetSecretKeyPassword ¶
func (c *Credential) GetSecretKeyPassword() string
type CredentialIface ¶
type ErrorResponse ¶
type Request ¶
type Request interface {
GetScheme() string
GetHttpMethod() string
GetDomain() string
GetAction() string
GetBodyReader() io.Reader
GetParams() map[string]string
GetFormParams() map[string]string
GetBody() []byte
GetPath() string
GetUrl() string
GetContentType() string
GetHeaders() map[string]string
GetApiVersion() string
GetServiceName() string
GetMaxAttempts() int
GetAutoRetries() bool
GetBodyStr() string
SetScheme(string)
SetDomain(string)
SetPath(string)
SetContentType(string)
SetHeaders(headers map[string]string)
SetServiceName(string)
SetBody([]byte)
SetAutoRetries(bool)
SetMaxAttempts(int)
}
type ZenlayerCloudSdkError ¶
func (*ZenlayerCloudSdkError) Error ¶
func (e *ZenlayerCloudSdkError) Error() string
func (*ZenlayerCloudSdkError) GetCode ¶
func (e *ZenlayerCloudSdkError) GetCode() string
func (*ZenlayerCloudSdkError) GetMessage ¶
func (e *ZenlayerCloudSdkError) GetMessage() string
func (*ZenlayerCloudSdkError) GetRequestId ¶
func (e *ZenlayerCloudSdkError) GetRequestId() string
Click to show internal directories.
Click to hide internal directories.