Documentation
¶
Index ¶
- Constants
- func AdjustHash(shardhash string, buckets int) (string, error)
- func AdjustHashOld(shardhash string, buckets int) (string, error)
- func BitCount(buckets int) (int, error)
- func FillZero(x string, n int) string
- func GenerateLog(logTime uint32, addLogMap map[string]string) *sls.Log
- func GetLogListSize(logList []*sls.Log) int
- func GetLogSizeCalculate(log *sls.Log) int
- func GetTimeMs(t int64) int64
- func Md5ToBin(md5 string) string
- func ToMd5(name string) string
- type Attempt
- type CallBack
- type IoThreadPool
- type IoWorker
- type LogAccumulator
- type Mover
- type Producer
- func (producer *Producer) Close(timeoutMs int64) error
- func (producer *Producer) HashSendLog(project, logstore, shardHash, topic, source string, log *sls.Log) error
- func (producer *Producer) HashSendLogList(project, logstore, shardHash, topic, source string, logList []*sls.Log) (err error)
- func (producer *Producer) HashSendLogListWithCallBack(project, logstore, shardHash, topic, source string, logList []*sls.Log, ...) (err error)
- func (producer *Producer) HashSendLogWithCallBack(project, logstore, shardHash, topic, source string, log *sls.Log, ...) error
- func (producer *Producer) SafeClose()
- func (producer *Producer) SendLog(project, logstore, topic, source string, log *sls.Log) error
- func (producer *Producer) SendLogList(project, logstore, topic, source string, logList []*sls.Log) (err error)
- func (producer *Producer) SendLogListWithCallBack(project, logstore, topic, source string, logList []*sls.Log, callback CallBack) (err error)
- func (producer *Producer) SendLogWithCallBack(project, logstore, topic, source string, log *sls.Log, callback CallBack) error
- func (producer *Producer) Start()
- type ProducerBatch
- type ProducerConfig
- type Result
- func (result *Result) GetErrorCode() string
- func (result *Result) GetErrorMessage() string
- func (result *Result) GetLastAttemptCostMs() int64
- func (result *Result) GetRequestId() string
- func (result *Result) GetReservedAttempts() []*Attempt
- func (result *Result) GetTimeStampMs() int64
- func (result *Result) IsSuccessful() bool
- type RetryQueue
- type UpdateStsTokenFunc
Constants ¶
View Source
const ( TimeoutExecption = "TimeoutExecption" IllegalStateException = "IllegalStateException" )
View Source
const Delimiter = "|"
Variables ¶
This section is empty.
Functions ¶
func AdjustHashOld ¶ added in v0.1.12
func GenerateLog ¶
func GetLogListSize ¶
func GetLogListSize(logList []*sls.Log) int
func GetLogSizeCalculate ¶
func GetLogSizeCalculate(log *sls.Log) int
Types ¶
type IoThreadPool ¶
type IoThreadPool struct {
// contains filtered or unexported fields
}
type LogAccumulator ¶
type LogAccumulator struct {
// contains filtered or unexported fields
}
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func InitProducer ¶
func InitProducer(producerConfig *ProducerConfig) *Producer
func (*Producer) Close ¶
Limited closing transfer parameter nil, safe closing transfer timeout time, timeout Ms parameter in milliseconds
func (*Producer) HashSendLog ¶
func (*Producer) HashSendLogList ¶
func (*Producer) HashSendLogListWithCallBack ¶
func (*Producer) HashSendLogWithCallBack ¶
func (*Producer) SendLogList ¶
func (*Producer) SendLogListWithCallBack ¶
func (*Producer) SendLogWithCallBack ¶
type ProducerBatch ¶
type ProducerBatch struct {
// contains filtered or unexported fields
}
type ProducerConfig ¶
type ProducerConfig struct {
TotalSizeLnBytes int64
MaxIoWorkerCount int64
MaxBlockSec int
MaxBatchSize int64
MaxBatchCount int
LingerMs int64
Retries int
MaxReservedAttempts int
BaseRetryBackoffMs int64
MaxRetryBackoffMs int64
AdjustShargHash bool
Buckets int
AllowLogLevel string
LogFileName string
IsJsonType bool
LogMaxSize int
LogMaxBackups int
LogCompress bool
Endpoint string
NoRetryStatusCodeList []int
HTTPClient *http.Client
UserAgent string
LogTags []*sls.LogTag
GeneratePackId bool
CredentialsProvider sls.CredentialsProvider
UseMetricStoreURL bool
// Deprecated: use CredentialsProvider and UpdateFuncProviderAdapter instead.
//
// Example:
// provider := sls.NewUpdateFuncProviderAdapter(updateStsTokenFunc)
// config := &ProducerConfig{
// CredentialsProvider: provider,
// }
UpdateStsToken UpdateStsTokenFunc
StsTokenShutDown chan struct{}
AccessKeyID string // Deprecated: use CredentialsProvider instead
AccessKeySecret string // Deprecated: use CredentialsProvider instead
Region string
AuthVersion sls.AuthVersionType
CompressType int // only work for logstore now
// contains filtered or unexported fields
}
func GetDefaultProducerConfig ¶
func GetDefaultProducerConfig() *ProducerConfig
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) GetErrorCode ¶
func (*Result) GetErrorMessage ¶
func (*Result) GetLastAttemptCostMs ¶ added in v0.1.29
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.