Documentation ¶
Overview ¶
Package cls provides simple API for CLS.
Index ¶
- type AlphabeticCaseInsensitive
- type Client
- type ErrorInfo
- type Log
- func (*Log) Descriptor() ([]byte, []int)
- func (m *Log) GetContents() []*Log_Content
- func (m *Log) GetTime() int64
- func (*Log) ProtoMessage()
- func (m *Log) Reset()
- func (m *Log) String() string
- 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) GetLogs() []*Log
- func (m *LogGroup) GetSource() string
- func (*LogGroup) ProtoMessage()
- func (m *LogGroup) Reset()
- func (m *LogGroup) String() string
- 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 (*LogGroupList) ProtoMessage()
- func (m *LogGroupList) Reset()
- func (m *LogGroupList) String() string
- 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 LogObject
- type LogService
- func (p *LogService) Search(searchReq SearchReq) (SearchResp, error)
- func (p *LogService) SearchAll(ctx context.Context, w io.Writer, searchReq SearchReq) ([]string, error)
- func (p *LogService) SearchWithContext(ctx context.Context, searchReq SearchReq) (SearchResp, error)
- func (p *LogService) Upload(topicID string, l *LogGroupList, compress, hash bool) (string, error)
- type Log_Content
- func (*Log_Content) Descriptor() ([]byte, []int)
- func (m *Log_Content) GetKey() string
- func (m *Log_Content) GetValue() string
- func (*Log_Content) ProtoMessage()
- func (m *Log_Content) Reset()
- func (m *Log_Content) String() string
- 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 SearchReq
- type SearchResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlphabeticCaseInsensitive ¶
type AlphabeticCaseInsensitive []string
AlphabeticCaseInsensitive 用于大小写不敏感的字母序排序。
func (AlphabeticCaseInsensitive) Len ¶
func (p AlphabeticCaseInsensitive) Len() int
func (AlphabeticCaseInsensitive) Less ¶
func (p AlphabeticCaseInsensitive) Less(i, j int) bool
func (AlphabeticCaseInsensitive) Swap ¶
func (p AlphabeticCaseInsensitive) Swap(i, j int)
type Client ¶
type Client struct { SecretID string `validate:"required"` SecretKey string `validate:"required"` Scheme string `validate:"oneof=http https"` Host string `validate:"fqdn"` SignAlgorithm string `validate:"oneof=sha1"` CompressType string `validate:"oneof=lz4"` Expire time.Duration `validate:"required"` Log *LogService // contains filtered or unexported fields }
Client 表示与 CLS API 通信所需的数据结构。
type ErrorInfo ¶
type ErrorInfo struct { ErrorCode string `json:"errorcode"` ErrorMessage string `json:"errormessage"` }
ErrorInfo 表示 CLS API 返回的错误信息。
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Log) Descriptor ¶
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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*LogGroup) Descriptor ¶
func (*LogGroup) GetContextFlow ¶
func (*LogGroup) GetFilename ¶
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) ProtoMessage ¶
func (*LogGroupList) ProtoMessage()
func (*LogGroupList) Reset ¶
func (m *LogGroupList) Reset()
func (*LogGroupList) String ¶
func (m *LogGroupList) String() string
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 LogObject ¶
type LogObject struct { Content string `json:"content"` Filename string `json:"filename"` Source string `json:"source"` Timestamp string `json:"timestamp"` TopicID string `json:"topic_id"` TopicName string `json:"topic_name"` }
LogObject 表示日志内容信息。
type LogService ¶
type LogService service
LogService 表示日志管理相关 API。
func (*LogService) Search ¶
func (p *LogService) Search(searchReq SearchReq) (SearchResp, error)
Search 用于搜索日志,单次返回的最大条数为100。
func (*LogService) SearchAll ¶ added in v0.0.2
func (p *LogService) SearchAll(ctx context.Context, w io.Writer, searchReq SearchReq) ([]string, error)
SearchAll 用于搜索日志,最多 10000 条。
func (*LogService) SearchWithContext ¶ added in v0.0.2
func (p *LogService) SearchWithContext(ctx context.Context, searchReq SearchReq) (SearchResp, error)
SearchWithContext 用于搜索日志,通过 context 控制生命周期,单次返回的最大条数为100。
func (*LogService) Upload ¶
func (p *LogService) Upload(topicID string, l *LogGroupList, compress, hash bool) (string, error)
Upload 用于上传结构化日志。 如果 hash 为 true,则使用哈希路由模式,以保证数据在该分区上写入和消费是严格保序的。 https://cloud.tencent.com/document/product/614/39259
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) ProtoMessage ¶
func (*Log_Content) ProtoMessage()
func (*Log_Content) Reset ¶
func (m *Log_Content) Reset()
func (*Log_Content) String ¶
func (m *Log_Content) String() string
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 SearchReq ¶ added in v0.0.2
type SearchReq struct { LogSetID string `validate:"required"` TopicIDs []string `validate:"required"` StartTime time.Time `validate:"required"` EndTime time.Time `validate:"required"` Query string `validate:"omitempty"` Limit int `validate:"min=1,max=100"` Context string `validate:"omitempty"` Sort string `validate:"omitempty,oneof=asc desc"` }
SearchReq 表示 CLS 搜索日志 API 请求参数。
Click to show internal directories.
Click to hide internal directories.