代码拉取完成,页面将自动刷新
package pipeline
import (
"errors"
"fmt"
"github.com/elastic/beats/libbeat/beat"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/processors"
)
// Config object for loading a pipeline instance via Load.
type Config struct {
// Event processing configurations
common.EventMetadata `config:",inline"` // Fields and tags to add to each event.
Processors processors.PluginConfig `config:"processors"`
// Event queue
Queue common.ConfigNamespace `config:"queue"`
}
// validateClientConfig checks a ClientConfig can be used with (*Pipeline).ConnectWith.
func validateClientConfig(c *beat.ClientConfig) error {
withDrop := false
switch m := c.PublishMode; m {
case beat.DefaultGuarantees, beat.GuaranteedSend:
case beat.DropIfFull:
withDrop = true
default:
return fmt.Errorf("unknown publishe mode %v", m)
}
fnCount := 0
countPtr := func(b bool) {
if b {
fnCount++
}
}
countPtr(c.ACKCount != nil)
countPtr(c.ACKEvents != nil)
countPtr(c.ACKLastEvent != nil)
if fnCount > 1 {
return fmt.Errorf("At most one of ACKCount, ACKEvents, ACKLastEvent can be configured")
}
// ACK handlers can not be registered DropIfFull is set, as dropping events
// due to full broker can not be accounted for in the clients acker.
if fnCount != 0 && withDrop {
return errors.New("ACK handlers with DropIfFull mode not supported")
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。