Documentation
¶
Index ¶
- Constants
- Variables
- func DeflateCompress(data []byte) ([]byte, error)
- func GenerateProducerHash(instanceID string) string
- func GetLocalIP() (string, error)
- func GetLogListSize(logList []*Log) (int, error)
- func GetLogSizeCalculate(log *Log) (int, error)
- func GetTimeMs(t int64) int64
- func NewCLSClient(options *Options) (*CLSClient, *CLSError)
- func SetUserAgent(agent string)
- func SetVersion(ver string)
- func SignatureWithTC3(secretID, secretKey, service, method, path string, queryString string, ...) (string, error)
- func ZSTDCompress(params ZstdEncoderParams, dst, src []byte) ([]byte, error)
- func ZSTDDecompress(params ZstdDecoderParams, dst, src []byte) ([]byte, error)
- type APIError
- type Accumulator
- type AsyncProducerClient
- func (producer *AsyncProducerClient) Close(timeoutMs int64) error
- func (producer *AsyncProducerClient) SendLog(topicId string, log *Log, callback CallBack) error
- func (producer *AsyncProducerClient) SendLogList(topicId string, logList []*Log, callback CallBack) (err error)
- func (producer *AsyncProducerClient) Start()
- type AsyncProducerClientConfig
- type Attempt
- type CLSClient
- type CLSError
- type CallBack
- type ConsumerGroupEntity
- type ConsumerGroupGetOffsetsResponse
- type ConsumerGroupHeartBeatResponse
- type ConsumerGroupUpdateOffsetsResponse
- type CreateConsumerGroupRequest
- type CreateConsumerGroupResponse
- type Credentials
- type DeleteConsumerGroupRequest
- type DeleteConsumerGroupResponse
- type ErrorMessage
- type Field
- type GetOffsetsRequest
- type HeartbeatRequest
- type ListConsumerGroupRequest
- type ListConsumerGroupResponse
- type Log
- func (*Log) Descriptor() ([]byte, []int)
- func (m *Log) GetCollectTime() int64
- func (m *Log) GetContents() []*Log_Content
- func (m *Log) GetTime() int64
- func (m *Log) Marshal() (dAtA []byte, err error)
- func (m *Log) MarshalTo(dAtA []byte) (int, error)
- func (m *Log) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Log) ProtoMessage()
- func (m *Log) Reset()
- func (m *Log) Size() (n int)
- func (m *Log) String() string
- func (m *Log) Unmarshal(dAtA []byte) error
- func (m *Log) XXX_DiscardUnknown()
- func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Log) XXX_Merge(src proto.Message)
- func (m *Log) XXX_Size() int
- func (m *Log) XXX_Unmarshal(b []byte) error
- type LogGroup
- func (*LogGroup) Descriptor() ([]byte, []int)
- func (m *LogGroup) GetContextFlow() string
- func (m *LogGroup) GetFilename() string
- func (m *LogGroup) GetHostname() string
- func (m *LogGroup) GetLogTags() []*LogTag
- func (m *LogGroup) GetLogs() []*Log
- func (m *LogGroup) GetSource() string
- func (m *LogGroup) Marshal() (dAtA []byte, err error)
- func (m *LogGroup) MarshalTo(dAtA []byte) (int, error)
- func (m *LogGroup) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LogGroup) ProtoMessage()
- func (m *LogGroup) Reset()
- func (m *LogGroup) Size() (n int)
- func (m *LogGroup) String() string
- func (m *LogGroup) Unmarshal(dAtA []byte) error
- func (m *LogGroup) XXX_DiscardUnknown()
- func (m *LogGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LogGroup) XXX_Merge(src proto.Message)
- func (m *LogGroup) XXX_Size() int
- func (m *LogGroup) XXX_Unmarshal(b []byte) error
- type LogGroupList
- func (*LogGroupList) Descriptor() ([]byte, []int)
- func (m *LogGroupList) GetLogGroupList() []*LogGroup
- func (m *LogGroupList) Marshal() (dAtA []byte, err error)
- func (m *LogGroupList) MarshalTo(dAtA []byte) (int, error)
- func (m *LogGroupList) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LogGroupList) ProtoMessage()
- func (m *LogGroupList) Reset()
- func (m *LogGroupList) Size() (n int)
- func (m *LogGroupList) String() string
- func (m *LogGroupList) Unmarshal(dAtA []byte) error
- func (m *LogGroupList) XXX_DiscardUnknown()
- func (m *LogGroupList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LogGroupList) XXX_Merge(src proto.Message)
- func (m *LogGroupList) XXX_Size() int
- func (m *LogGroupList) XXX_Unmarshal(b []byte) error
- type LogSendRetryQueue
- type LogTag
- func (*LogTag) Descriptor() ([]byte, []int)
- func (m *LogTag) GetKey() string
- func (m *LogTag) GetValue() string
- func (m *LogTag) Marshal() (dAtA []byte, err error)
- func (m *LogTag) MarshalTo(dAtA []byte) (int, error)
- func (m *LogTag) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LogTag) ProtoMessage()
- func (m *LogTag) Reset()
- func (m *LogTag) Size() (n int)
- func (m *LogTag) String() string
- func (m *LogTag) Unmarshal(dAtA []byte) error
- func (m *LogTag) XXX_DiscardUnknown()
- func (m *LogTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LogTag) XXX_Merge(src proto.Message)
- func (m *LogTag) XXX_Size() int
- func (m *LogTag) XXX_Unmarshal(b []byte) error
- type Log_Content
- func (*Log_Content) Descriptor() ([]byte, []int)
- func (m *Log_Content) GetKey() string
- func (m *Log_Content) GetValue() string
- func (m *Log_Content) Marshal() (dAtA []byte, err error)
- func (m *Log_Content) MarshalTo(dAtA []byte) (int, error)
- func (m *Log_Content) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Log_Content) ProtoMessage()
- func (m *Log_Content) Reset()
- func (m *Log_Content) Size() (n int)
- func (m *Log_Content) String() string
- func (m *Log_Content) Unmarshal(dAtA []byte) error
- func (m *Log_Content) XXX_DiscardUnknown()
- func (m *Log_Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Log_Content) XXX_Merge(src proto.Message)
- func (m *Log_Content) XXX_Size() int
- func (m *Log_Content) XXX_Unmarshal(b []byte) error
- type Logger
- type NetworkType
- type Options
- type PartitionInfo
- type PartitionOffset
- type ProducerBatch
- type PullLogResponse
- type PullLogsClient
- type PullLogsRequest
- type Region
- type Result
- type SendThreadPool
- type SyncProducerClient
- func (c *SyncProducerClient) ResetSecretToken(secretID string, secretKEY string, secretToken string) error
- func (c *SyncProducerClient) SendLogGroupList(ctx context.Context, topicID string, logGroupList []*LogGroup) error
- func (c *SyncProducerClient) SendLogList(ctx context.Context, topicID string, logList []*Log) error
- type SyncProducerClientConfig
- type TimerSendLogTask
- type TopicPartitionOffsetsInfo
- type UpdateConsumerGroupRequest
- type UpdateConsumerGroupResponse
- type UpdateOffsetsRequest
- type Worker
- type YunApiLogClient
- func (c *YunApiLogClient) CreateConsumerGroup(logsetId, consumerGroup string, timeout int, topics []string) (*CreateConsumerGroupResponse, error)
- func (c *YunApiLogClient) DeleteConsumerGroup(logsetId, consumerGroup string) (*DeleteConsumerGroupResponse, error)
- func (c *YunApiLogClient) DoRequest(method string, resource string, params map[string]string, ...) ([]byte, error)
- func (c *YunApiLogClient) GetOffsets(logsetId, consumerGroup, topicId string, partitionId int, position string) (*ConsumerGroupGetOffsetsResponse, error)
- func (c *YunApiLogClient) Heartbeat(logsetId, consumerGroup, consumer string, partitions []PartitionInfo) (*ConsumerGroupHeartBeatResponse, error)
- func (c *YunApiLogClient) ListConsumerGroup(logsetId string, topics []string) (*ListConsumerGroupResponse, error)
- func (c *YunApiLogClient) UpdateConsumerGroup(logsetId, consumerGroup string, topics []string, timeout *int) (*UpdateConsumerGroupResponse, error)
- func (c *YunApiLogClient) UpdateOffsets(logsetId, consumerGroup, consumer string, offsets []TopicPartitionOffsetsInfo) (*ConsumerGroupUpdateOffsetsResponse, error)
- type YunApiLogClientConfig
- type ZapLogger
- type ZstdDecoderParams
- type ZstdEncoderParams
Constants ¶
const BAD_REQUEST = "BadRequest"
const CompressionLevelDefault = -1000
const INTERNAL_SERVER_ERROR = "InternalError"
const MISSING_HOST = "MissingHost"
const MISS_ACCESS_KEY_ID = "MissAccessKeyId"
const MISS_ACCESS_SECRET = "MissAccessKeyId"
const MISS_ACCESS_TOKEN = "MissAccessKeyId"
const UNKNOWN_ERROR = "UnknownError"
const WRITE_QUOTA_EXCEED = "WriteQuotaExceed"
Variables ¶
Functions ¶
func DeflateCompress ¶ added in v1.0.13
DeflateCompress ...
func GenerateProducerHash ¶ added in v1.0.7
GenerateProducerHash ...
func GetLogListSize ¶
func GetLogSizeCalculate ¶
func NewCLSClient ¶
func SignatureWithTC3 ¶ added in v1.0.15
func SignatureWithTC3(secretID, secretKey, service, method, path string, queryString string, headers map[string]string, payload []byte, timestamp int64) (string, error)
SignatureWithTC3 generates TC3-HMAC-SHA256 signature
func ZSTDCompress ¶ added in v1.0.2
func ZSTDCompress(params ZstdEncoderParams, dst, src []byte) ([]byte, error)
func ZSTDDecompress ¶ added in v1.0.2
func ZSTDDecompress(params ZstdDecoderParams, dst, src []byte) ([]byte, error)
Types ¶
type Accumulator ¶
type Accumulator struct {
// contains filtered or unexported fields
}
func NewAccumulator ¶
func NewAccumulator(config *AsyncProducerClientConfig, worker *Worker, threadPool *SendThreadPool, producer *AsyncProducerClient) *Accumulator
NewAccumulator ...
type AsyncProducerClient ¶
type AsyncProducerClient struct {
Client *CLSClient
// contains filtered or unexported fields
}
AsyncProducerClient async producer client
func NewAsyncProducerClient ¶
func NewAsyncProducerClient(asyncProducerClientConfig *AsyncProducerClientConfig) (*AsyncProducerClient, error)
NewAsyncProducerClient 初始化Async Producer Client
func (*AsyncProducerClient) Close ¶
func (producer *AsyncProducerClient) Close(timeoutMs int64) error
func (*AsyncProducerClient) SendLog ¶
func (producer *AsyncProducerClient) SendLog(topicId string, log *Log, callback CallBack) error
func (*AsyncProducerClient) SendLogList ¶
func (producer *AsyncProducerClient) SendLogList(topicId string, logList []*Log, callback CallBack) (err error)
func (*AsyncProducerClient) Start ¶
func (producer *AsyncProducerClient) Start()
type AsyncProducerClientConfig ¶
type AsyncProducerClientConfig struct {
TotalSizeLnBytes int64
MaxSendWorkerCount int64
MaxBlockSec int
MaxBatchSize int64
MaxBatchCount int
LingerMs int64
Retries int
MaxReservedAttempts int
BaseRetryBackoffMs int64
MaxRetryBackoffMs int64
Endpoint string
AccessKeyID string
AccessKeySecret string
AccessToken string
Source string
Timeout int
IdleConn int
CompressType string
HostName string
// contains filtered or unexported fields
}
AsyncProducerClientConfig Producer Config
func GetDefaultAsyncProducerClientConfig ¶
func GetDefaultAsyncProducerClientConfig() *AsyncProducerClientConfig
GetDefaultAsyncProducerClientConfig 获取默认的Producer Config
func (*AsyncProducerClientConfig) SetEndpointByRegionAndNetworkType ¶ added in v1.0.12
func (config *AsyncProducerClientConfig) SetEndpointByRegionAndNetworkType(region Region, networkType NetworkType)
SetEndpointByRegionAndNetworkType 根据地域和网络类型设置域名
type Attempt ¶
type CLSClient ¶
type CLSClient struct {
// contains filtered or unexported fields
}
func (*CLSClient) ResetSecretToken ¶
type CLSError ¶
type CLSError struct {
HTTPCode int32 `json:"httpCode"`
Code string `json:"errorCode"`
Message string `json:"errorMessage"`
RequestID string `json:"requestID"`
}
Error defines sls error
type ConsumerGroupEntity ¶ added in v1.0.15
type ConsumerGroupGetOffsetsResponse ¶ added in v1.0.15
type ConsumerGroupGetOffsetsResponse struct {
Response struct {
ConsumerGroup string `json:"ConsumerGroup"`
TopicPartitionOffsetsInfo []TopicPartitionOffsetsInfo `json:"TopicPartitionOffsetsInfo"`
RequestId string `json:"RequestId"`
Error *APIError `json:"Error,omitempty"`
} `json:"Response"`
}
ConsumerGroupGetOffsetsResponse get offset response
type ConsumerGroupHeartBeatResponse ¶ added in v1.0.15
type ConsumerGroupHeartBeatResponse struct {
Response struct {
ConsumerGroup string `json:"ConsumerGroup,omitempty"`
TopicPartitionsInfo []PartitionInfo `json:"TopicPartitionsInfo,omitempty"`
RequestId string `json:"RequestId"`
Error *APIError `json:"Error,omitempty"`
} `json:"Response"`
}
ConsumerGroupHeartBeatResponse heartbeat response
type ConsumerGroupUpdateOffsetsResponse ¶ added in v1.0.15
type ConsumerGroupUpdateOffsetsResponse struct {
Response struct {
RequestId string `json:"RequestId"`
Error *APIError `json:"Error,omitempty"`
} `json:"Response"`
}
ConsumerGroupUpdateOffsetsResponse update offset response
type CreateConsumerGroupRequest ¶ added in v1.0.15
type CreateConsumerGroupRequest struct {
ConsumerGroup string `json:"ConsumerGroup"`
Timeout int `json:"Timeout"`
Topics []string `json:"Topics"`
LogsetId string `json:"LogsetId"`
}
CreateConsumerGroupRequest create consumer group request
type CreateConsumerGroupResponse ¶ added in v1.0.15
type Credentials ¶ added in v1.0.6
type DeleteConsumerGroupRequest ¶ added in v1.0.15
type DeleteConsumerGroupRequest struct {
LogsetId string `json:"LogsetId"`
ConsumerGroup string `json:"ConsumerGroup"`
}
DeleteConsumerGroupRequest delete consumer group request
type DeleteConsumerGroupResponse ¶ added in v1.0.15
type DeleteConsumerGroupResponse struct {
Response struct {
RequestId string `json:"RequestId"`
Error *APIError `json:"Error,omitempty"`
} `json:"Response"`
}
DeleteConsumerGroupResponse supports capturing all fields
type ErrorMessage ¶
type GetOffsetsRequest ¶ added in v1.0.15
type GetOffsetsRequest struct {
ConsumerGroup string `json:"ConsumerGroup"`
TopicId string `json:"TopicId"`
PartitionId string `json:"PartitionId,omitempty"`
LogsetId string `json:"LogsetId"`
From string `json:"From,omitempty"`
}
GetOffsetsRequest get offset request body
type HeartbeatRequest ¶ added in v1.0.15
type HeartbeatRequest struct {
ConsumerGroup string `json:"ConsumerGroup"`
Consumer string `json:"Consumer"`
LogsetId string `json:"LogsetId"`
TopicPartitionsInfo []PartitionInfo `json:"TopicPartitionsInfo"`
PartitionStrategy int `json:"PartitionStrategy"`
}
HeartbeatRequest heartbeat request body
type ListConsumerGroupRequest ¶ added in v1.0.15
type ListConsumerGroupRequest struct {
LogsetId string `json:"LogsetId"`
Topics []string `json:"Topics"`
}
ListConsumerGroupRequest list consumer group request
type ListConsumerGroupResponse ¶ added in v1.0.15
type ListConsumerGroupResponse struct {
Response struct {
ConsumerGroupsInfo []ConsumerGroupEntity `json:"ConsumerGroupsInfo"`
RequestId string `json:"RequestId"`
Error *APIError `json:"Error,omitempty"`
} `json:"Response"`
}
type Log ¶
type Log struct {
Time *int64 `protobuf:"varint,1,req,name=time" json:"time,omitempty"`
Contents []*Log_Content `protobuf:"bytes,2,rep,name=contents" json:"contents,omitempty"`
CollectTime *int64 `protobuf:"varint,3,opt,name=collectTime" json:"collectTime,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Log) Descriptor ¶
func (*Log) GetCollectTime ¶ added in v1.0.8
func (*Log) GetContents ¶
func (m *Log) GetContents() []*Log_Content
func (*Log) ProtoMessage ¶
func (*Log) ProtoMessage()
func (*Log) XXX_DiscardUnknown ¶
func (m *Log) XXX_DiscardUnknown()
func (*Log) XXX_Unmarshal ¶
type LogGroup ¶
type LogGroup struct {
Logs []*Log `protobuf:"bytes,1,rep,name=logs" json:"logs,omitempty"`
ContextFlow *string `protobuf:"bytes,2,opt,name=contextFlow" json:"contextFlow,omitempty"`
Filename *string `protobuf:"bytes,3,opt,name=filename" json:"filename,omitempty"`
Source *string `protobuf:"bytes,4,opt,name=source" json:"source,omitempty"`
LogTags []*LogTag `protobuf:"bytes,5,rep,name=logTags" json:"logTags,omitempty"`
Hostname *string `protobuf:"bytes,6,opt,name=hostname" json:"hostname,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*LogGroup) Descriptor ¶
func (*LogGroup) GetContextFlow ¶
func (*LogGroup) GetFilename ¶
func (*LogGroup) GetHostname ¶ added in v1.0.8
func (*LogGroup) GetLogTags ¶
func (*LogGroup) MarshalToSizedBuffer ¶
func (*LogGroup) ProtoMessage ¶
func (*LogGroup) ProtoMessage()
func (*LogGroup) XXX_DiscardUnknown ¶
func (m *LogGroup) XXX_DiscardUnknown()
func (*LogGroup) XXX_Marshal ¶
func (*LogGroup) XXX_Unmarshal ¶
type LogGroupList ¶
type LogGroupList struct {
LogGroupList []*LogGroup `protobuf:"bytes,1,rep,name=logGroupList" json:"logGroupList,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*LogGroupList) Descriptor ¶
func (*LogGroupList) Descriptor() ([]byte, []int)
func (*LogGroupList) GetLogGroupList ¶
func (m *LogGroupList) GetLogGroupList() []*LogGroup
func (*LogGroupList) Marshal ¶
func (m *LogGroupList) Marshal() (dAtA []byte, err error)
func (*LogGroupList) MarshalToSizedBuffer ¶
func (m *LogGroupList) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LogGroupList) ProtoMessage ¶
func (*LogGroupList) ProtoMessage()
func (*LogGroupList) Reset ¶
func (m *LogGroupList) Reset()
func (*LogGroupList) Size ¶
func (m *LogGroupList) Size() (n int)
func (*LogGroupList) String ¶
func (m *LogGroupList) String() string
func (*LogGroupList) Unmarshal ¶
func (m *LogGroupList) Unmarshal(dAtA []byte) error
func (*LogGroupList) XXX_DiscardUnknown ¶
func (m *LogGroupList) XXX_DiscardUnknown()
func (*LogGroupList) XXX_Marshal ¶
func (m *LogGroupList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LogGroupList) XXX_Merge ¶
func (m *LogGroupList) XXX_Merge(src proto.Message)
func (*LogGroupList) XXX_Size ¶
func (m *LogGroupList) XXX_Size() int
func (*LogGroupList) XXX_Unmarshal ¶
func (m *LogGroupList) XXX_Unmarshal(b []byte) error
type LogSendRetryQueue ¶
type LogSendRetryQueue struct {
// contains filtered or unexported fields
}
LogSendRetryQueue RetryQueue cache ProducerBatch and retry latter
func (*LogSendRetryQueue) Len ¶
func (retryQueue *LogSendRetryQueue) Len() int
func (*LogSendRetryQueue) Less ¶
func (retryQueue *LogSendRetryQueue) Less(i, j int) bool
func (*LogSendRetryQueue) Pop ¶
func (retryQueue *LogSendRetryQueue) Pop() interface{}
func (*LogSendRetryQueue) Push ¶
func (retryQueue *LogSendRetryQueue) Push(x interface{})
func (*LogSendRetryQueue) Swap ¶
func (retryQueue *LogSendRetryQueue) Swap(i, j int)
type LogTag ¶
type LogTag struct {
Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"`
Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*LogTag) Descriptor ¶
func (*LogTag) MarshalToSizedBuffer ¶
func (*LogTag) ProtoMessage ¶
func (*LogTag) ProtoMessage()
func (*LogTag) XXX_DiscardUnknown ¶
func (m *LogTag) XXX_DiscardUnknown()
func (*LogTag) XXX_Marshal ¶
func (*LogTag) XXX_Unmarshal ¶
type Log_Content ¶
type Log_Content struct {
Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"`
Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Log_Content) Descriptor ¶
func (*Log_Content) Descriptor() ([]byte, []int)
func (*Log_Content) GetKey ¶
func (m *Log_Content) GetKey() string
func (*Log_Content) GetValue ¶
func (m *Log_Content) GetValue() string
func (*Log_Content) Marshal ¶
func (m *Log_Content) Marshal() (dAtA []byte, err error)
func (*Log_Content) MarshalToSizedBuffer ¶
func (m *Log_Content) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Log_Content) ProtoMessage ¶
func (*Log_Content) ProtoMessage()
func (*Log_Content) Reset ¶
func (m *Log_Content) Reset()
func (*Log_Content) Size ¶
func (m *Log_Content) Size() (n int)
func (*Log_Content) String ¶
func (m *Log_Content) String() string
func (*Log_Content) Unmarshal ¶
func (m *Log_Content) Unmarshal(dAtA []byte) error
func (*Log_Content) XXX_DiscardUnknown ¶
func (m *Log_Content) XXX_DiscardUnknown()
func (*Log_Content) XXX_Marshal ¶
func (m *Log_Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Log_Content) XXX_Merge ¶
func (m *Log_Content) XXX_Merge(src proto.Message)
func (*Log_Content) XXX_Size ¶
func (m *Log_Content) XXX_Size() int
func (*Log_Content) XXX_Unmarshal ¶
func (m *Log_Content) XXX_Unmarshal(b []byte) error
type NetworkType ¶ added in v1.0.12
type NetworkType string
NetworkType 网络类型,可以将string赋值给该类型,实现自定义网络类型
const ( Intranet NetworkType = "cls.tencentyun.com" //内网 Extranet NetworkType = "cls.tencentcs.com" //外网 )
type Options ¶
type Options struct {
Host string
Timeout int
IdleConn int
CompressType string
Credentials Credentials
}
type PartitionInfo ¶ added in v1.0.15
type PartitionOffset ¶ added in v1.0.15
PartitionOffset partition offset
type ProducerBatch ¶
type ProducerBatch struct {
// contains filtered or unexported fields
}
func NewProducerBatch ¶
func NewProducerBatch(topicID string, config *AsyncProducerClientConfig, callBackFunc CallBack, logData interface{}, packageID string) *ProducerBatch
NewProducerBatch 初始化Producer batch
type PullLogResponse ¶ added in v1.0.15
type PullLogResponse struct {
NextOffset int64
LogGroups []*LogGroup
Headers map[string]string
// contains filtered or unexported fields
}
func ParsePullLogResponse ¶ added in v1.0.15
func ParsePullLogResponse(respBytes []byte) (*PullLogResponse, error)
ParsePullLogResponse parses the binary response of pulling logs and returns a PullLogResponse object
func (*PullLogResponse) GetLogCount ¶ added in v1.0.15
func (r *PullLogResponse) GetLogCount() int
GetLogCount returns the number of all logs
func (*PullLogResponse) GetLogGroups ¶ added in v1.0.15
func (r *PullLogResponse) GetLogGroups() []*LogGroup
GetLogGroups returns all log groups
func (*PullLogResponse) GetNextOffset ¶ added in v1.0.15
func (r *PullLogResponse) GetNextOffset() int64
GetNextOffset returns the next offset
type PullLogsClient ¶ added in v1.0.15
type PullLogsClient struct {
Endpoint string
SecretId string
SecretKey string
Token string
UserAgent string
}
func NewPullLogsClient ¶ added in v1.0.15
func NewPullLogsClient(endpoint, secretId, secretKey, token, userAgent string) *PullLogsClient
func (*PullLogsClient) PullLogs ¶ added in v1.0.15
func (c *PullLogsClient) PullLogs(topicId string, partitionId int, size int, startTime *int64, offset int64, endTime *int64, query string) ([]byte, error)
PullLogs pulls logs and returns snappy compressed binary data. query is an optional DSL pre-filter expression; pass "" to disable server-side filtering.
func (*PullLogsClient) PullLogsAndParse ¶ added in v1.0.15
func (c *PullLogsClient) PullLogsAndParse(topicId string, partitionId int, size int, startTime *int64, offset int64, endTime *int64, query string) (*PullLogResponse, error)
PullLogsAndParse pulls and parses logs and outputs proto text format. query is an optional DSL pre-filter expression; pass "" to disable server-side filtering.
type PullLogsRequest ¶ added in v1.0.15
type PullLogsRequest struct {
StartOffset int64 `json:"StartOffset"`
Size int `json:"Size"`
CompressType string `json:"CompressType"`
PartitionId int `json:"PartitionId"`
StartTime int64 `json:"StartTime"`
EndTime *int64 `json:"EndTime,omitempty"`
// Query is an optional DSL pre-filter expression applied on the server side
// before logs are returned. Example:
// log_keep(op_and(op_gt(v("status"), 400), str_exist(v("message"), "access failed")))
// See https://cloud.tencent.com/document/product/614/37908 for the full DSL syntax.
Query string `json:"Query"`
}
type Region ¶ added in v1.0.12
type Region string
Region 地域类型,可以将string赋值给该类型,实现自定义地域
const ( Beijing Region = "ap-beijing" Guangzhou Region = "ap-guangzhou" Shanghai Region = "ap-shanghai" Chengdu Region = "ap-chengdu" Nanjing Region = "ap-nanjing" Chongqing Region = "ap-chongqing" Hongkong Region = "ap-hongkong" Siliconvalley Region = "na-siliconvalley" Ashburn Region = "na-ashburn" Singapore Region = "ap-singapore" Bangkok Region = "ap-bangkok" Frankfurt Region = "eu-frankfurt" Tokyo Region = "ap-tokyo" Seoul Region = "ap-seoul" Jakarta Region = "ap-jakarta" Saopaulo Region = "sa-saopaulo" ShenzhenFSI Region = "ap-shenzhen-fsi" ShanghaiFSI Region = "ap-shanghai-fsi" BeijingFSI Region = "ap-beijing-fsi" ShanghaiADC Region = "ap-shanghai-adc" )
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 SendThreadPool ¶
type SendThreadPool struct {
// contains filtered or unexported fields
}
func NewSendThreadPool ¶
func NewSendThreadPool(worker *Worker) *SendThreadPool
type SyncProducerClient ¶ added in v1.0.3
type SyncProducerClient struct {
// contains filtered or unexported fields
}
SyncProducerClient synchronized producer client
func NewSyncProducerClient ¶ added in v1.0.3
func NewSyncProducerClient(config *SyncProducerClientConfig) (*SyncProducerClient, error)
NewSyncProducerClient new sync producer client
func (*SyncProducerClient) ResetSecretToken ¶ added in v1.0.3
func (c *SyncProducerClient) ResetSecretToken(secretID string, secretKEY string, secretToken string) error
ResetSecretToken reset temporary secret info
func (*SyncProducerClient) SendLogGroupList ¶ added in v1.0.6
func (c *SyncProducerClient) SendLogGroupList(ctx context.Context, topicID string, logGroupList []*LogGroup) error
SendLogGroupList send batched logs to cls
func (*SyncProducerClient) SendLogList ¶ added in v1.0.3
SendLogList send batched logs to cls
type SyncProducerClientConfig ¶ added in v1.0.3
type SyncProducerClientConfig struct {
Endpoint string
AccessKeyID string
AccessKeySecret string
AccessToken string
Timeout int
IdleConn int
CompressType string
NeedSource bool
HostName string
// contains filtered or unexported fields
}
SyncProducerClientConfig sync producer config
func GetDefaultSyncProducerClientConfig ¶ added in v1.0.3
func GetDefaultSyncProducerClientConfig() *SyncProducerClientConfig
GetDefaultSyncProducerClientConfig get default sync producer config
func (*SyncProducerClientConfig) SetEndpointByRegionAndNetworkType ¶ added in v1.0.12
func (config *SyncProducerClientConfig) SetEndpointByRegionAndNetworkType(region Region, networkType NetworkType)
SetEndpointByRegionAndNetworkType 根据地域和网络类型设置域名
type TimerSendLogTask ¶
type TimerSendLogTask struct {
// contains filtered or unexported fields
}
func NewTimerSendLogTask ¶
func NewTimerSendLogTask(logAccumulator *Accumulator, retryQueue *LogSendRetryQueue, ioWorker *Worker, threadPool *SendThreadPool) *TimerSendLogTask
type TopicPartitionOffsetsInfo ¶ added in v1.0.15
type TopicPartitionOffsetsInfo struct {
TopicID string `json:"TopicID"`
PartitionOffsets []PartitionOffset `json:"PartitionOffsets"`
}
TopicPartitionOffsetsInfo topic partition offset information
type UpdateConsumerGroupRequest ¶ added in v1.0.15
type UpdateConsumerGroupRequest struct {
LogsetId string `json:"LogsetId"`
ConsumerGroup string `json:"ConsumerGroup"`
Topics []string `json:"Topics,omitempty"`
Timeout *int `json:"Timeout,omitempty"`
}
UpdateConsumerGroupRequest update consumer group request
type UpdateConsumerGroupResponse ¶ added in v1.0.15
type UpdateConsumerGroupResponse struct {
Response struct {
RequestId string `json:"RequestId"`
Error *APIError `json:"Error,omitempty"`
} `json:"Response"`
}
UpdateConsumerGroupResponse supports capturing all fields
type UpdateOffsetsRequest ¶ added in v1.0.15
type UpdateOffsetsRequest struct {
TopicPartitionOffsetsInfo []TopicPartitionOffsetsInfo `json:"TopicPartitionOffsetsInfo"`
ConsumerGroup string `json:"ConsumerGroup"`
Consumer string `json:"Consumer"`
LogsetId string `json:"LogsetId"`
}
UpdateOffsetsRequest update offset request body
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func NewWorker ¶
func NewWorker(clsClient *CLSClient, retryQueue *LogSendRetryQueue, maxSendWorkerCount int64, producer *AsyncProducerClient) *Worker
NewWorker ...
type YunApiLogClient ¶ added in v1.0.15
type YunApiLogClient struct {
*CLSClient
// contains filtered or unexported fields
}
func NewYunApiLogClient ¶ added in v1.0.15
func NewYunApiLogClient(accessKeyId, accessKey string, internal bool, securityToken, source, region string) *YunApiLogClient
NewYunApiLogClient constructor
func NewYunApiLogClientSimple ¶ added in v1.0.15
func NewYunApiLogClientSimple(accessKeyId, accessKey string) *YunApiLogClient
NewYunApiLogClientSimple simple constructor, only requires essential parameters
func NewYunApiLogClientWithConfig ¶ added in v1.0.15
func NewYunApiLogClientWithConfig(config YunApiLogClientConfig) *YunApiLogClient
NewYunApiLogClientWithConfig constructor using configuration struct, supports optional parameters
func (*YunApiLogClient) CreateConsumerGroup ¶ added in v1.0.15
func (c *YunApiLogClient) CreateConsumerGroup(logsetId, consumerGroup string, timeout int, topics []string) (*CreateConsumerGroupResponse, error)
CreateConsumerGroup create consumer group
func (*YunApiLogClient) DeleteConsumerGroup ¶ added in v1.0.15
func (c *YunApiLogClient) DeleteConsumerGroup(logsetId, consumerGroup string) (*DeleteConsumerGroupResponse, error)
DeleteConsumerGroup delete consumer group
func (*YunApiLogClient) DoRequest ¶ added in v1.0.15
func (c *YunApiLogClient) DoRequest( method string, resource string, params map[string]string, headers map[string]string, body []byte, region string, action string, responseBodyType string, service string, ) ([]byte, error)
DoRequest
func (*YunApiLogClient) GetOffsets ¶ added in v1.0.15
func (c *YunApiLogClient) GetOffsets(logsetId, consumerGroup, topicId string, partitionId int, position string) (*ConsumerGroupGetOffsetsResponse, error)
GetOffsets get offsets
func (*YunApiLogClient) Heartbeat ¶ added in v1.0.15
func (c *YunApiLogClient) Heartbeat(logsetId, consumerGroup, consumer string, partitions []PartitionInfo) (*ConsumerGroupHeartBeatResponse, error)
Heartbeat heartbeat
func (*YunApiLogClient) ListConsumerGroup ¶ added in v1.0.15
func (c *YunApiLogClient) ListConsumerGroup(logsetId string, topics []string) (*ListConsumerGroupResponse, error)
ListConsumerGroup list consumer groups
func (*YunApiLogClient) UpdateConsumerGroup ¶ added in v1.0.15
func (c *YunApiLogClient) UpdateConsumerGroup(logsetId, consumerGroup string, topics []string, timeout *int) (*UpdateConsumerGroupResponse, error)
UpdateConsumerGroup update consumer group
func (*YunApiLogClient) UpdateOffsets ¶ added in v1.0.15
func (c *YunApiLogClient) UpdateOffsets(logsetId, consumerGroup, consumer string, offsets []TopicPartitionOffsetsInfo) (*ConsumerGroupUpdateOffsetsResponse, error)
UpdateOffsets update offsets
type YunApiLogClientConfig ¶ added in v1.0.15
type YunApiLogClientConfig struct {
AccessKeyId string
AccessKey string
Internal bool
SecurityToken string
Source string
Region string
}
YunApiLogClientConfig configuration struct, supports optional parameters
type ZapLogger ¶ added in v1.0.15
type ZapLogger struct {
// contains filtered or unexported fields
}
func GetZapLoggerAdapter ¶ added in v1.0.15
func GetZapLoggerAdapter() *ZapLogger
provide get logger instance function
func NewZapLogger ¶ added in v1.0.15
type ZstdDecoderParams ¶ added in v1.0.2
type ZstdDecoderParams struct {
}
type ZstdEncoderParams ¶ added in v1.0.2
type ZstdEncoderParams struct {
Level int
}
Source Files
¶
- async_producer_client.go
- async_producer_client_config.go
- attempt.go
- callback.go
- cls.pb.go
- cls_client.go
- cls_endpoint.go
- deflate.go
- error.go
- error_code.go
- log_accumulator.go
- log_send_retry_queue.go
- log_send_thread_pool.go
- logger.go
- producer_batch.go
- pull_logs.go
- result.go
- signature.go
- sync_producer_client.go
- sync_producer_client_config.go
- tc3_signature.go
- timer_send_log_task.go
- utils.go
- version.go
- woker.go
- yunapi_log_client.go
- zstd.go
