Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultChannelBufferSize = 16
View Source
const DefaultTransferPrefix = "logtail-"
View Source
const DoubleSize = 2
View Source
const TransferFileSize = 1024 * 1024 * 8
TransferFileSize 8 MB for each transfer file.
View Source
const TypeConsole = "console"
View Source
const TypeDing = "ding"
View Source
const TypeFile = "file"
View Source
const TypeLark = "lark"
TypeLark transfer type lark.
View Source
const TypeNull = "null"
View Source
const TypeWebhook = "webhook"
Variables ¶
View Source
var ErrHTTPStatusNonOK = errors.New("http status non ok")
View Source
var Types = []string{TypeNull, TypeConsole, TypeFile, TypeWebhook, TypeDing, TypeLark}
Types all transfer types.
Functions ¶
func EscapeLimitJSONBytes ¶
func SetTransStatisticDuration ¶ added in v1.5.0
Types ¶
type ConsoleTransfer ¶
type ConsoleTransfer struct {
ID string
}
func (*ConsoleTransfer) Name ¶
func (d *ConsoleTransfer) Name() string
func (*ConsoleTransfer) Start ¶
func (d *ConsoleTransfer) Start() error
func (*ConsoleTransfer) Stop ¶
func (d *ConsoleTransfer) Stop() error
func (*ConsoleTransfer) Trans ¶
func (d *ConsoleTransfer) Trans(source string, data ...[]byte) error
func (*ConsoleTransfer) Visit ¶
func (d *ConsoleTransfer) Visit(t Transfer)
type Counter ¶ added in v1.5.0
type Counter struct {
// contains filtered or unexported fields
}
Counter is a utility to count the count of transfer times.
func (*Counter) CountIncr ¶ added in v1.5.0
func (c *Counter) CountIncr()
CountIncr increase the counter.
func (*Counter) CountReset ¶ added in v1.5.0
CountReset reset the counter and return the statistic message.
type DingTransfer ¶
type DingTransfer struct { Counter // contains filtered or unexported fields }
func NewDingTransfer ¶
func NewDingTransfer(id, url, prefix string) *DingTransfer
NewDingTransfer new dingding trans.
func (*DingTransfer) Name ¶
func (d *DingTransfer) Name() string
func (*DingTransfer) Start ¶
func (d *DingTransfer) Start() error
func (*DingTransfer) Stop ¶
func (d *DingTransfer) Stop() error
type FileTransfer ¶
type FileTransfer struct {
// contains filtered or unexported fields
}
func NewFileTransfer ¶
func NewFileTransfer(id, dir string) *FileTransfer
NewFileTransfer new file trans.
func (*FileTransfer) Name ¶
func (ft *FileTransfer) Name() string
func (*FileTransfer) Start ¶
func (ft *FileTransfer) Start() error
func (*FileTransfer) Stop ¶
func (ft *FileTransfer) Stop() error
type LarkTransfer ¶
type LarkTransfer struct { Counter // contains filtered or unexported fields }
LarkTransfer transfer to support lark.
func NewLarkTransfer ¶
func NewLarkTransfer(id, url, prefix string) *LarkTransfer
NewLarkTransfer initialize a lark trans.
func (*LarkTransfer) Name ¶
func (d *LarkTransfer) Name() string
func (*LarkTransfer) Start ¶
func (d *LarkTransfer) Start() error
func (*LarkTransfer) Stop ¶
func (d *LarkTransfer) Stop() error
type NullTransfer ¶
type NullTransfer struct {
ID string
}
func (*NullTransfer) Name ¶
func (d *NullTransfer) Name() string
func (*NullTransfer) Start ¶
func (d *NullTransfer) Start() error
func (*NullTransfer) Stop ¶
func (d *NullTransfer) Stop() error
type TransferMatcher ¶ added in v1.5.0
type WebhookTransfer ¶
type WebhookTransfer struct {
// contains filtered or unexported fields
}
func NewWebhookTransfer ¶
func NewWebhookTransfer(id, url, prefix string) *WebhookTransfer
NewWebhookTransfer new webhook trans.
func (*WebhookTransfer) Name ¶
func (d *WebhookTransfer) Name() string
func (*WebhookTransfer) Start ¶
func (d *WebhookTransfer) Start() error
func (*WebhookTransfer) Stop ¶
func (d *WebhookTransfer) Stop() error
Click to show internal directories.
Click to hide internal directories.