Versions in this module Expand all Collapse all v0 v0.0.1 Dec 30, 2022 Changes in this version + const HeaderJcloudPrefix + const HeaderJdcloudPrefix + const HeaderJdcloudRequestId + const LogError + const LogFatal + const LogInfo + const LogWarn + const MethodDelete + const MethodGet + const MethodHead + const MethodPatch + const MethodPost + const MethodPut + const SchemeHttp + const SchemeHttps + const Version + func EscapePath(path string, encodeSep bool) string + type Config struct + Endpoint string + Scheme string + Timeout time.Duration + func NewConfig() *Config + func (c *Config) SetEndpoint(endpoint string) + func (c *Config) SetScheme(scheme string) + func (c *Config) SetTimeout(timeout time.Duration) + type Credential struct + AccessKey string + SecretKey string + func NewCredentials(accessKey, secretKey string) *Credential + type DefaultLogger struct + Level int + func NewDefaultLogger(level int) *DefaultLogger + func (logger DefaultLogger) Log(level int, message ...interface{}) + type DummyLogger struct + func NewDummyLogger() *DummyLogger + func (logger DummyLogger) Log(level int, message ...interface{}) + type ErrorResponse struct + Code int + Message string + Status string + type JDCloudClient struct + Config Config + Credential Credential + Logger Logger + Revision string + ServiceName string + func (c JDCloudClient) Send(request RequestInterface, serviceName string) ([]byte, error) + type JDCloudRequest struct + Header map[string]string + Method string + URL string + Version string + func (r *JDCloudRequest) AddHeader(key, value string) + func (r JDCloudRequest) GetHeaders() map[string]string + func (r JDCloudRequest) GetMethod() string + func (r JDCloudRequest) GetURL() string + func (r JDCloudRequest) GetVersion() string + type Logger interface + Log func(level int, message ...interface{}) + type ParameterBuilder interface + BuildBody func(paramJson []byte) (string, error) + BuildURL func(url string, paramJson []byte) (string, error) + func GetParameterBuilder(method string, logger Logger) ParameterBuilder + type RequestInterface interface + GetHeaders func() map[string]string + GetMethod func() string + GetRegionId func() string + GetURL func() string + GetVersion func() string + type ResponseProcessor interface + Process func(response *http.Response) ([]byte, error) + func GetResponseProcessor(method string) ResponseProcessor + type SignFunc func(*http.Request) error + type Signer struct + Credentials Credential + Logger Logger + func NewSigner(credsProvider Credential, logger Logger) *Signer + func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region string, ...) (http.Header, error) + type WithBodyBuilder struct + Logger Logger + func (b WithBodyBuilder) BuildBody(paramJson []byte) (string, error) + func (b WithBodyBuilder) BuildURL(url string, paramJson []byte) (string, error) + type WithBodyResponseProcessor struct + func (p WithBodyResponseProcessor) Process(response *http.Response) ([]byte, error) + type WithoutBodyBuilder struct + Logger Logger + func (b WithoutBodyBuilder) BuildBody(paramJson []byte) (string, error) + func (b WithoutBodyBuilder) BuildURL(url string, paramJson []byte) (string, error) + type WithoutBodyResponseProcessor struct + func (p WithoutBodyResponseProcessor) Process(response *http.Response) ([]byte, error)