Documentation
¶
Overview ¶
Package sls is a generated protocol buffer package.
It is generated from these files:
log.proto
It has these top-level messages:
LogContent Log LogTag LogGroup SlsLogPackage SlsLogPackageList LogGroupList
Index ¶
- Constants
- Variables
- func APISign(secret string, method string, headers map[string]string, resource string) string
- type Config
- type Log
- func (*Log) Descriptor() ([]byte, []int)
- func (m *Log) GetContents() []*LogContent
- func (m *Log) GetTime() uint32
- func (m *Log) Marshal() (dAtA []byte, err error)
- func (m *Log) MarshalTo(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
- type LogContent
- func (*LogContent) Descriptor() ([]byte, []int)
- func (m *LogContent) GetKey() string
- func (m *LogContent) GetValue() string
- func (m *LogContent) Marshal() (dAtA []byte, err error)
- func (m *LogContent) MarshalTo(dAtA []byte) (int, error)
- func (*LogContent) ProtoMessage()
- func (m *LogContent) Reset()
- func (m *LogContent) Size() (n int)
- func (m *LogContent) String() string
- func (m *LogContent) Unmarshal(dAtA []byte) error
- type LogGroup
- func (*LogGroup) Descriptor() ([]byte, []int)
- func (m *LogGroup) GetCategory() string
- func (m *LogGroup) GetLogTags() []*LogTag
- func (m *LogGroup) GetLogs() []*Log
- func (m *LogGroup) GetMachineUUID() string
- func (m *LogGroup) GetSource() string
- func (m *LogGroup) GetTopic() string
- func (m *LogGroup) Marshal() (dAtA []byte, err error)
- func (m *LogGroup) MarshalTo(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
- type LogGroupList
- func (*LogGroupList) Descriptor() ([]byte, []int)
- func (m *LogGroupList) GetLogGroups() []*LogGroup
- func (m *LogGroupList) Marshal() (dAtA []byte, err error)
- func (m *LogGroupList) MarshalTo(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
- 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 (*LogTag) ProtoMessage()
- func (m *LogTag) Reset()
- func (m *LogTag) Size() (n int)
- func (m *LogTag) String() string
- func (m *LogTag) Unmarshal(dAtA []byte) error
- type NoopFormatter
- type SlsClient
- type SlsLogPackage
- func (*SlsLogPackage) Descriptor() ([]byte, []int)
- func (m *SlsLogPackage) GetData() []byte
- func (m *SlsLogPackage) GetUncompressSize() int32
- func (m *SlsLogPackage) Marshal() (dAtA []byte, err error)
- func (m *SlsLogPackage) MarshalTo(dAtA []byte) (int, error)
- func (*SlsLogPackage) ProtoMessage()
- func (m *SlsLogPackage) Reset()
- func (m *SlsLogPackage) Size() (n int)
- func (m *SlsLogPackage) String() string
- func (m *SlsLogPackage) Unmarshal(dAtA []byte) error
- type SlsLogPackageList
- func (*SlsLogPackageList) Descriptor() ([]byte, []int)
- func (m *SlsLogPackageList) GetPackages() []*SlsLogPackage
- func (m *SlsLogPackageList) Marshal() (dAtA []byte, err error)
- func (m *SlsLogPackageList) MarshalTo(dAtA []byte) (int, error)
- func (*SlsLogPackageList) ProtoMessage()
- func (m *SlsLogPackageList) Reset()
- func (m *SlsLogPackageList) Size() (n int)
- func (m *SlsLogPackageList) String() string
- func (m *SlsLogPackageList) Unmarshal(dAtA []byte) error
- type SlsLogrusHook
Constants ¶
View Source
const ( DefaultTimeout = 5 * time.Second MaxLogItemSize = 512 * 1024 // Safe value for maximum 1M log item. MaxLogGroupSize = 4 * 1024 * 1024 // Safe value for maximum 5M log group MaxLogBatchSize = 1024 // Safe value for batch send size )
Default config for sls client
View Source
const ( SlsVersion = "0.6.0" SlsSignatureMethod = "hmac-sha1" HeaderAuthorization = "Authorization" HeaderContentType = "Content-Type" HeaderContentLength = "Content-Length" HeaderContentMd5 = "Content-MD5" HeaderDate = "Date" HeaderHost = "Host" HeaderLogVersion = "x-log-apiversion" HeaderLogSignatureMethod = "x-log-signaturemethod" HeaderLogBodyRawSize = "x-log-bodyrawsize" )
Sls constants
View Source
const ( BufferSize = 4096 DefaultSendInterval = 300 * time.Millisecond MaxBatchSize = 300 )
Default config for sls logrus hooks
Variables ¶
View Source
var ( ErrInvalidLengthLog = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowLog = fmt.Errorf("proto: integer overflow") )
Functions ¶
Types ¶
type Log ¶
type Log struct { Time *uint32 `protobuf:"varint,1,req,name=Time" json:"Time,omitempty"` Contents []*LogContent `protobuf:"bytes,2,rep,name=Contents" json:"Contents,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Log) Descriptor ¶
func (*Log) GetContents ¶
func (m *Log) GetContents() []*LogContent
func (*Log) ProtoMessage ¶
func (*Log) ProtoMessage()
type LogContent ¶
type LogContent struct { Key *string `protobuf:"bytes,1,req,name=Key" json:"Key,omitempty"` Value *string `protobuf:"bytes,2,req,name=Value" json:"Value,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*LogContent) Descriptor ¶
func (*LogContent) Descriptor() ([]byte, []int)
func (*LogContent) GetKey ¶
func (m *LogContent) GetKey() string
func (*LogContent) GetValue ¶
func (m *LogContent) GetValue() string
func (*LogContent) Marshal ¶
func (m *LogContent) Marshal() (dAtA []byte, err error)
func (*LogContent) ProtoMessage ¶
func (*LogContent) ProtoMessage()
func (*LogContent) Reset ¶
func (m *LogContent) Reset()
func (*LogContent) Size ¶
func (m *LogContent) Size() (n int)
func (*LogContent) String ¶
func (m *LogContent) String() string
func (*LogContent) Unmarshal ¶
func (m *LogContent) Unmarshal(dAtA []byte) error
type LogGroup ¶
type LogGroup struct { Logs []*Log `protobuf:"bytes,1,rep,name=Logs" json:"Logs,omitempty"` Category *string `protobuf:"bytes,2,opt,name=Category" json:"Category,omitempty"` Topic *string `protobuf:"bytes,3,opt,name=Topic" json:"Topic,omitempty"` Source *string `protobuf:"bytes,4,opt,name=Source" json:"Source,omitempty"` MachineUUID *string `protobuf:"bytes,5,opt,name=MachineUUID" json:"MachineUUID,omitempty"` LogTags []*LogTag `protobuf:"bytes,6,rep,name=LogTags" json:"LogTags,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*LogGroup) Descriptor ¶
func (*LogGroup) GetCategory ¶
func (*LogGroup) GetLogTags ¶
func (*LogGroup) GetMachineUUID ¶
func (*LogGroup) ProtoMessage ¶
func (*LogGroup) ProtoMessage()
type LogGroupList ¶
type LogGroupList struct { LogGroups []*LogGroup `protobuf:"bytes,1,rep,name=LogGroups" json:"LogGroups,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*LogGroupList) Descriptor ¶
func (*LogGroupList) Descriptor() ([]byte, []int)
func (*LogGroupList) GetLogGroups ¶
func (m *LogGroupList) GetLogGroups() []*LogGroup
func (*LogGroupList) Marshal ¶
func (m *LogGroupList) Marshal() (dAtA []byte, err 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
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_unrecognized []byte `json:"-"` }
func (*LogTag) Descriptor ¶
func (*LogTag) ProtoMessage ¶
func (*LogTag) ProtoMessage()
type SlsClient ¶
type SlsClient struct {
// contains filtered or unexported fields
}
SlsClient the client struct for sls connection
func NewSlsClient ¶
NewSlsClient create a new sls client
type SlsLogPackage ¶
type SlsLogPackage struct { Data []byte `protobuf:"bytes,1,req,name=data" json:"data,omitempty"` UncompressSize *int32 `protobuf:"varint,2,opt,name=uncompress_size,json=uncompressSize" json:"uncompress_size,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*SlsLogPackage) Descriptor ¶
func (*SlsLogPackage) Descriptor() ([]byte, []int)
func (*SlsLogPackage) GetData ¶
func (m *SlsLogPackage) GetData() []byte
func (*SlsLogPackage) GetUncompressSize ¶
func (m *SlsLogPackage) GetUncompressSize() int32
func (*SlsLogPackage) Marshal ¶
func (m *SlsLogPackage) Marshal() (dAtA []byte, err error)
func (*SlsLogPackage) ProtoMessage ¶
func (*SlsLogPackage) ProtoMessage()
func (*SlsLogPackage) Reset ¶
func (m *SlsLogPackage) Reset()
func (*SlsLogPackage) Size ¶
func (m *SlsLogPackage) Size() (n int)
func (*SlsLogPackage) String ¶
func (m *SlsLogPackage) String() string
func (*SlsLogPackage) Unmarshal ¶
func (m *SlsLogPackage) Unmarshal(dAtA []byte) error
type SlsLogPackageList ¶
type SlsLogPackageList struct { Packages []*SlsLogPackage `protobuf:"bytes,1,rep,name=packages" json:"packages,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*SlsLogPackageList) Descriptor ¶
func (*SlsLogPackageList) Descriptor() ([]byte, []int)
func (*SlsLogPackageList) GetPackages ¶
func (m *SlsLogPackageList) GetPackages() []*SlsLogPackage
func (*SlsLogPackageList) Marshal ¶
func (m *SlsLogPackageList) Marshal() (dAtA []byte, err error)
func (*SlsLogPackageList) MarshalTo ¶
func (m *SlsLogPackageList) MarshalTo(dAtA []byte) (int, error)
func (*SlsLogPackageList) ProtoMessage ¶
func (*SlsLogPackageList) ProtoMessage()
func (*SlsLogPackageList) Reset ¶
func (m *SlsLogPackageList) Reset()
func (*SlsLogPackageList) Size ¶
func (m *SlsLogPackageList) Size() (n int)
func (*SlsLogPackageList) String ¶
func (m *SlsLogPackageList) String() string
func (*SlsLogPackageList) Unmarshal ¶
func (m *SlsLogPackageList) Unmarshal(dAtA []byte) error
type SlsLogrusHook ¶
type SlsLogrusHook struct {
// contains filtered or unexported fields
}
SlsLogrusHook logrus hook for sls
func New ¶
func New(config *Config) (*SlsLogrusHook, error)
func NewSlsLogrusHook ¶
func NewSlsLogrusHook(endpoint string, accessKey string, accessSecret string, logStore string, topic string) (*SlsLogrusHook, error)
NewSlsLogrusHook create logrus hook
func (*SlsLogrusHook) Fire ¶
func (hook *SlsLogrusHook) Fire(entry *logrus.Entry) error
Fire implement logrus Hook interface
func (*SlsLogrusHook) Flush ¶
func (hook *SlsLogrusHook) Flush(timeout time.Duration)
Flush ensure logs are flush through sls api
func (*SlsLogrusHook) Levels ¶
func (hook *SlsLogrusHook) Levels() []logrus.Level
Levels implement logrus Hook interface
func (*SlsLogrusHook) SetSendInterval ¶
func (hook *SlsLogrusHook) SetSendInterval(interval time.Duration)
SetSendInterval change batch send interval
Click to show internal directories.
Click to hide internal directories.