1 Star 0 Fork 0

sqos/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
event.go 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
package publisher
import (
"github.com/elastic/beats/libbeat/beat"
)
// Batch is used to pass a batch of events to the outputs and asynchronously listening
// for signals from these outpts. After a batch is processed (completed or
// errors), one of the signal methods must be called.
type Batch interface {
Events() []Event
// signals
ACK()
Drop()
Retry()
RetryEvents(events []Event)
Cancelled()
CancelledEvents(events []Event)
}
// Event is used by the publisher pipeline and broker to pass additional
// meta-data to the consumers/outputs.
type Event struct {
Content beat.Event
Flags EventFlags
}
// EventFlags provides additional flags/option types for used with the outputs.
type EventFlags uint8
const (
// GuaranteedSend requires an output to not drop the event on failure, but
// retry until ACK.
GuaranteedSend EventFlags = 0x01
)
// Guaranteed checks if the event must not be dropped by the output or the
// publisher pipeline.
func (e *Event) Guaranteed() bool {
return (e.Flags & GuaranteedSend) == GuaranteedSend
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v6.1.2

搜索帮助