Documentation ¶
Index ¶
- Constants
- func AdjustHash(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
- type RetryQueue
Constants ¶
View Source
const ( TimeoutExecption = "TimeoutExecption" IllegalStateException = "IllegalStateException" )
View Source
const Delimiter = "|"
Variables ¶
This section is empty.
Functions ¶
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 AccessKeyID string AccessKeySecret string NoRetryStatusCodeList []int }
func GetDefaultProducerConfig ¶
func GetDefaultProducerConfig() *ProducerConfig
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) GetErrorCode ¶
func (*Result) GetErrorMessage ¶
func (*Result) GetRequestId ¶
func (*Result) GetReservedAttempts ¶
func (*Result) GetTimeStampMs ¶
func (*Result) IsSuccessful ¶
type RetryQueue ¶
type RetryQueue []*ProducerBatch
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.