Documentation
¶
Index ¶
- func CRC64Combine(crc1 uint64, crc2 uint64, len2 uint64) uint64
- func ComplexReader(reader io.Reader, refer map[string]string) io.ReadCloser
- func NewCRC(tab *crc64.Table, init uint64) *digest
- func Prettify(i interface{}) string
- func TeeReader(reader io.Reader, writer io.Writer, totalBytes int64, ...) io.ReadCloser
- func XmlUnmarshal(body []byte, result interface{}) (interface{}, error)
- type BaseClient
- func (client *BaseClient) Base64Decode(value string) string
- func (client *BaseClient) Default(realStr string, defaultStr string) string
- func (client *BaseClient) DefaultNumber(num int, defaultNum int) int
- func (client *BaseClient) Empty(val string) bool
- func (client *BaseClient) Encode(val string, encodeType string) string
- func (client *BaseClient) Equal(val, val2 string) bool
- func (client *BaseClient) GetAccessKeyID() (string, error)
- func (client *BaseClient) GetAccessKeySecret() (string, error)
- func (client *BaseClient) GetContentMD5(a string) string
- func (client *BaseClient) GetContentType(name string) string
- func (client *BaseClient) GetDate() string
- func (client *BaseClient) GetErrMessage(bodyStr string) map[string]interface{}
- func (client *BaseClient) GetSecurityToken() (string, error)
- func (client *BaseClient) GetSignatureV1(request *tea.Request, bucketName, accessKeySecret string) string
- func (client *BaseClient) GetSignatureV2(request *tea.Request, bucketName, accessKeySecret string, ...) string
- func (client *BaseClient) GetSpecialValue(obj map[string]interface{}, key string) string
- func (client *BaseClient) GetUserAgent() string
- func (client *BaseClient) IfListEmpty(val []string) bool
- func (client *BaseClient) InitClient(config map[string]interface{}) error
- func (client *BaseClient) Inject(body io.Reader, ref map[string]string) io.Reader
- func (client *BaseClient) IsFail(response *tea.Response) bool
- func (client *BaseClient) ListToString(a []string, sep string) string
- func (client *BaseClient) NotNull(obj map[string]interface{}) bool
- func (client *BaseClient) ParseMeta(meta map[string]string, prefix string) map[string]string
- func (client *BaseClient) ParseUint(respCrc string, hasRange bool) uint64
- func (client *BaseClient) ParseXml(val string, result interface{}) map[string]interface{}
- func (client *BaseClient) ReadAsStream(response *tea.Response) io.ReadCloser
- func (client *BaseClient) ReadAsString(resp *tea.Response) (string, error)
- func (client *BaseClient) ToHeader(raw map[string]interface{}) map[string]string
- func (client *BaseClient) ToMeta(meta map[string]string, prefix string) map[string]string
- func (client *BaseClient) ToQuery(filter map[string]interface{}) map[string]string
- func (client *BaseClient) ToXML(obj map[string]interface{}) string
- func (client *BaseClient) UrlDecode(value string) string
- type LimitSpeedReader
- type OssLimiter
- type ServiceError
- type Sorter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CRC64Combine ¶
CRC64Combine combines CRC64
func ComplexReader ¶
func NewCRC ¶
NewCRC creates a new hash.Hash64 computing the CRC64 checksum using the polynomial represented by the Table.
func TeeReader ¶
func TeeReader(reader io.Reader, writer io.Writer, totalBytes int64, listener utils.ProgressListener, tracker *utils.ReaderTracker) io.ReadCloser
TeeReader returns a Reader that writes to w what it reads from r. All reads from r performed through it are matched with corresponding writes to w. There is no internal buffering - the write must complete before the read completes. Any error encountered while writing is reported as a read error.
func XmlUnmarshal ¶
Types ¶
type BaseClient ¶
type BaseClient struct {
RegionId string `json:"RegionId" xml:"RegionId"`
Protocol string `json:"Protocol" xml:"Protocol"`
Endpoint string `json:"Endpoint" xml:"Endpoint"`
UserAgent string `json:"UserAgent" xml:"UserAgent"`
HostModel string `json:"HostModel" xml:"HostModel"`
SignatureVersion string `json:"SignatureVersion" xml:"SignatureVersion"`
IsEnableMD5 bool `json:"IsEnableMD5" xml:"IsEnableMD5"`
IsEnableCrc bool `json:"IsEnableCrc" xml:"IsEnableCrc"`
ReadTimeout int `json:"ReadTimeout" xml:"ReadTimeout"`
ConnectTimeout int `json:"ConnectTimeout" xml:"ConnectTimeout"`
LocalAddr string `json:"LocalAddr" xml:"LocalAddr"`
HttpProxy string `json:"HttpProxy" xml:"HttpProxy"`
HttpsProxy string `json:"HttpsProxy" xml:"HttpsProxy"`
NoProxy string `json:"NoProxy" xml:"NoProxy"`
Socks5Proxy string `json:"SOCKS5Proxy" xml:"SOCKS5Proxy"`
Socks5NetWork string `json:"SOCKS5NetWork" xml:"SOCKS5NetWork"`
MaxIdleConns int `json:"MaxIdleConns" xml:"MaxIdleConns"`
AddtionalHeaders []string `json:"AddtionalHeaders" xml:"AddtionalHeaders"`
Logger *teautil.Logger
// contains filtered or unexported fields
}
Client is for calling oss api
func (*BaseClient) Base64Decode ¶
func (client *BaseClient) Base64Decode(value string) string
Decryption
func (*BaseClient) Default ¶
func (client *BaseClient) Default(realStr string, defaultStr string) string
If realStr is not "", return realStr, or return defaultStr
func (*BaseClient) DefaultNumber ¶
func (client *BaseClient) DefaultNumber(num int, defaultNum int) int
If num is not 0, return num, or return defaultNum
func (*BaseClient) Empty ¶
func (client *BaseClient) Empty(val string) bool
func (*BaseClient) Encode ¶
func (client *BaseClient) Encode(val string, encodeType string) string
Encryption
func (*BaseClient) Equal ¶
func (client *BaseClient) Equal(val, val2 string) bool
func (*BaseClient) GetAccessKeyID ¶
func (client *BaseClient) GetAccessKeyID() (string, error)
func (*BaseClient) GetAccessKeySecret ¶
func (client *BaseClient) GetAccessKeySecret() (string, error)
func (*BaseClient) GetContentMD5 ¶
func (client *BaseClient) GetContentMD5(a string) string
Return md5 according to body
func (*BaseClient) GetContentType ¶
func (client *BaseClient) GetContentType(name string) string
Return content-type according to object name
func (*BaseClient) GetErrMessage ¶
func (client *BaseClient) GetErrMessage(bodyStr string) map[string]interface{}
func (*BaseClient) GetSecurityToken ¶
func (client *BaseClient) GetSecurityToken() (string, error)
func (*BaseClient) GetSignatureV1 ¶
func (client *BaseClient) GetSignatureV1(request *tea.Request, bucketName, accessKeySecret string) string
func (*BaseClient) GetSignatureV2 ¶
func (*BaseClient) GetSpecialValue ¶
func (client *BaseClient) GetSpecialValue(obj map[string]interface{}, key string) string
Get value from obj according to key
func (*BaseClient) GetUserAgent ¶
func (client *BaseClient) GetUserAgent() string
func (*BaseClient) IfListEmpty ¶
func (client *BaseClient) IfListEmpty(val []string) bool
func (*BaseClient) InitClient ¶
func (client *BaseClient) InitClient(config map[string]interface{}) error
New a client according to config
func (*BaseClient) IsFail ¶
func (client *BaseClient) IsFail(response *tea.Response) bool
Determine whether the request failed
func (*BaseClient) ListToString ¶
func (client *BaseClient) ListToString(a []string, sep string) string
func (*BaseClient) NotNull ¶
func (client *BaseClient) NotNull(obj map[string]interface{}) bool
func (*BaseClient) ParseUint ¶
func (client *BaseClient) ParseUint(respCrc string, hasRange bool) uint64
Parse string to uint
func (*BaseClient) ParseXml ¶
func (client *BaseClient) ParseXml(val string, result interface{}) map[string]interface{}
Parse Body to map[string]interface{}
func (*BaseClient) ReadAsStream ¶
func (client *BaseClient) ReadAsStream(response *tea.Response) io.ReadCloser
func (*BaseClient) ReadAsString ¶
func (client *BaseClient) ReadAsString(resp *tea.Response) (string, error)
func (*BaseClient) ToHeader ¶
func (client *BaseClient) ToHeader(raw map[string]interface{}) map[string]string
func (*BaseClient) ToQuery ¶
func (client *BaseClient) ToQuery(filter map[string]interface{}) map[string]string
Parse filter to produce a map[string]string
func (*BaseClient) ToXML ¶
func (client *BaseClient) ToXML(obj map[string]interface{}) string
type LimitSpeedReader ¶
type LimitSpeedReader struct {
io.ReadCloser
// contains filtered or unexported fields
}
LimitSpeedReader for limit bandwidth upload
type OssLimiter ¶
type OssLimiter struct {
// contains filtered or unexported fields
}
OssLimiter wrapper rate.Limiter
func GetOssLimiter ¶
func GetOssLimiter(uploadSpeed int) (ossLimiter *OssLimiter)
GetOssLimiter create OssLimiter uploadSpeed KB/s
type ServiceError ¶
type ServiceError struct {
Code string `json:"Code" xml:"Code"`
Message string `json:"Message" xml:"Message"`
RequestId string `json:"RequestId" xml:"RequestId"`
HostId string `json:"HostId" xml:"HostId"`
}
ServiceError is for recording error which is caused when sending request
type Sorter ¶
Sorter defines the key-value structure for storing the sorted data in signHeader.