Documentation ¶
Index ¶
- Constants
- Variables
- func CanonicalHeadersBasic(r *http.Request, signerHeaders []string) string
- func CanonicalQueryStringBasic(r *http.Request) string
- func CanonicalRequestBasic(r *http.Request, signedHeaders []string) (string, error)
- func CanonicalURIBasic(r *http.Request) string
- func DerivationAuthHeaderValue(signature, accessKey string, info string, signedHeaders []string) string
- func GetDerivationKey(accessKey string, secretKey string, info string) (string, error)
- func GetLogListSize(logList []*Log) int
- func GetLogSizeCalculate(log *Log) int
- func GetTimeMs(t int64) int64
- func HexEncodeSHA256Hash(body []byte) (string, error)
- func IsDebugLevelMatched(level int) bool
- func RetryWithCondition(ctx context.Context, b backoff.BackOff, o ConditionOperation) error
- func SignHeaderBasic(r *http.Request, ak string, sk string, derivedAuthServiceName string, ...) (map[string]string, error)
- func SignStringToSign(stringToSign string, signingKey []byte) (string, error)
- func SignedHeadersBasic(headers map[string][]string) []string
- func StringToSignDerived(canonicalRequest string, info string, t time.Time) (string, error)
- type Attempt
- type BadResponseError
- type Batch
- type CallBack
- type Client
- type ClientInterface
- type ConditionOperation
- type Config
- type CustomLog
- type DefaultHttpRequest
- func (httpRequest *DefaultHttpRequest) GetBodyToBytes() (*bytes.Buffer, error)
- func (httpRequest *DefaultHttpRequest) GetEndpoint() string
- func (httpRequest *DefaultHttpRequest) GetHeaderParams() map[string]string
- func (httpRequest *DefaultHttpRequest) GetMethod() string
- func (httpRequest *DefaultHttpRequest) GetPath() string
- func (httpRequest *DefaultHttpRequest) GetQueryParams() map[string]interface{}
- type Error
- type HttpRequestBuilder
- type IoThreadPool
- type IoWorker
- type Log
- type LogAccumulator
- type LogContent
- type LogGroup
- type LogItem
- type LogItems
- type LogProject
- type LogStore
- type LogTag
- type Mover
- type Producer
- type Result
- func (result *Result) GetErrorCode() string
- func (result *Result) GetErrorMessage() string
- func (result *Result) GetHttpCode() int32
- func (result *Result) GetRequestId() string
- func (result *Result) GetReservedAttempts() []*Attempt
- func (result *Result) GetTimeStampMs() int64
- func (result *Result) IsSuccessful() bool
- type RetryQueue
Constants ¶
View Source
const ( CompressLz4 = iota // 0 CompressNone // 1 CompressGzip )
View Source
const ( BasicDateFormat = "20060102T150405Z" HeaderXDate = "X-Sdk-Date" HeaderHost = "host" HeaderAuthorization = "Authorization" HeaderContentSha256 = "X-Sdk-Content-Sha256" DerivationAlgorithm = "V11-HMAC-SHA256" DerivedDateFormat = "20060102" )
View Source
const Delimiter = "|"
View Source
const (
RequestIDHeader = "X-Request-Id"
)
View Source
const (
TimeoutExecption = "TimeoutExecption"
)
Variables ¶
View Source
var GlobalDebugLevel = 0
View Source
var RetryOnServerErrorEnabled = true
Functions ¶
func CanonicalHeadersBasic ¶
func CanonicalRequestBasic ¶
func CanonicalURIBasic ¶
func GetDerivationKey ¶
func GetLogListSize ¶
func GetLogSizeCalculate ¶
func HexEncodeSHA256Hash ¶
func IsDebugLevelMatched ¶
func RetryWithCondition ¶
func SignHeaderBasic ¶
func SignStringToSign ¶
func SignedHeadersBasic ¶
Types ¶
type BadResponseError ¶
func NewBadResponseError ¶
func NewBadResponseError(body string, header map[string][]string, httpCode int) *BadResponseError
func (BadResponseError) Error ¶
func (e BadResponseError) Error() string
func (BadResponseError) String ¶
func (e BadResponseError) String() string
type Client ¶
type ClientInterface ¶
func CreateNormalInterface ¶
func CreateNormalInterface(config *Config) ClientInterface
type ConditionOperation ¶
type Config ¶
type Config struct { TotalSizeLnBytes int64 MaxIoWorkers int64 MaxBlockSec int MaxBatchSize int64 MaxBatchCount int LingerMs int64 Retries int MaxReservedAttempts int BaseRetryBackoffMs int64 MaxRetryBackoffMs int64 Buckets int Endpoint string AccessKeyID string AccessKeySecret string ProjectId string RegionId string NoRetryCodeList []int HTTPClient *http.Client }
type DefaultHttpRequest ¶
type DefaultHttpRequest struct {
// contains filtered or unexported fields
}
func (*DefaultHttpRequest) GetBodyToBytes ¶
func (httpRequest *DefaultHttpRequest) GetBodyToBytes() (*bytes.Buffer, error)
func (*DefaultHttpRequest) GetEndpoint ¶
func (httpRequest *DefaultHttpRequest) GetEndpoint() string
func (*DefaultHttpRequest) GetHeaderParams ¶
func (httpRequest *DefaultHttpRequest) GetHeaderParams() map[string]string
func (*DefaultHttpRequest) GetMethod ¶
func (httpRequest *DefaultHttpRequest) GetMethod() string
func (*DefaultHttpRequest) GetPath ¶
func (httpRequest *DefaultHttpRequest) GetPath() string
func (*DefaultHttpRequest) GetQueryParams ¶
func (httpRequest *DefaultHttpRequest) GetQueryParams() map[string]interface{}
type Error ¶
type Error struct { HTTPCode int32 `json:"httpCode"` Code string `json:"errorCode"` Message string `json:"errorMessage"` RequestID string `json:"requestID"` }
func NewClientError ¶
type HttpRequestBuilder ¶
type HttpRequestBuilder struct {
// contains filtered or unexported fields
}
type IoThreadPool ¶
type IoThreadPool struct {
// contains filtered or unexported fields
}
type Log ¶
type Log struct { Time *uint32 `json:"time,omitempty"` Contents []*LogContent `json:"contents,omitempty"` Labels string `json:"labels"` ProjectId string `json:"tenant_project_id,omitempty"` }
func (*Log) GetContents ¶
func (m *Log) GetContents() []*LogContent
type LogAccumulator ¶
type LogAccumulator struct {
// contains filtered or unexported fields
}
type LogContent ¶
func (*LogContent) Size ¶
func (m *LogContent) Size() (n int)
type LogGroup ¶
type LogItem ¶
type LogItem struct { Contents []LogContent `json:"contents"` Labels string `json:"labels"` TenantProjectId string `json:"tenant_project_id"` }
type LogProject ¶
type LogProject struct { Region string // region id Endpoint string // IP or hostname AccessKeyID string AccessKeySecret string ProjectId string // contains filtered or unexported fields }
func NewLogProject ¶
func NewLogProject(client *Client) (p *LogProject, err error)
func (*LogProject) WithRequestTimeout ¶
func (p *LogProject) WithRequestTimeout(timeout time.Duration) *LogProject
func (*LogProject) WithRetryTimeout ¶
func (p *LogProject) WithRetryTimeout(timeout time.Duration) *LogProject
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func InitProducer ¶
func (*Producer) SendLogWithCallBack ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) GetErrorCode ¶
func (*Result) GetErrorMessage ¶
func (*Result) GetHttpCode ¶
func (*Result) GetRequestId ¶
func (*Result) GetReservedAttempts ¶
func (*Result) GetTimeStampMs ¶
func (*Result) IsSuccessful ¶
type RetryQueue ¶
type RetryQueue struct {
// contains filtered or unexported fields
}
RetryQueue cache ProducerBatch and retry latter
func (*RetryQueue) Len ¶
func (retryQueue *RetryQueue) Len() int
func (*RetryQueue) Less ¶
func (retryQueue *RetryQueue) Less(i, j int) bool
func (*RetryQueue) Pop ¶
func (retryQueue *RetryQueue) Pop() interface{}
func (*RetryQueue) Push ¶
func (retryQueue *RetryQueue) Push(x interface{})
func (*RetryQueue) Swap ¶
func (retryQueue *RetryQueue) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.