Documentation
¶
Index ¶
- Variables
- func AddSubscriptionTarget(msg proto.Message, meta Meta, addTarget string, tpl *template.Template) (*gnmi.SubscribeResponse, error)
- func DecodeConfig(src, dst interface{}) error
- func ExecTemplate(content []byte, tpl *template.Template) ([]byte, error)
- func Marshal(pmsg protoreflect.ProtoMessage, meta map[string]string, ...) ([][]byte, error)
- func Register(name string, initFn Initializer)
- type BaseOutput
- func (b *BaseOutput) Close() error
- func (b *BaseOutput) Init(context.Context, string, map[string]any, ...Option) error
- func (b *BaseOutput) RegisterMetrics(*prometheus.Registry)
- func (b *BaseOutput) String() string
- func (b *BaseOutput) Write(context.Context, proto.Message, Meta)
- func (b *BaseOutput) WriteEvent(context.Context, *formatters.EventMsg)
- type Initializer
- type Meta
- type Option
- func WithClusterName(name string) Option
- func WithEventProcessors(eps map[string]map[string]any, acts map[string]map[string]any) Option
- func WithLogger(logger *log.Logger) Option
- func WithName(name string) Option
- func WithRegistry(reg *prometheus.Registry) Option
- func WithTargetsConfig(tcs map[string]*types.TargetConfig) Option
- type Output
- type OutputOptions
- type ProtoMsg
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultTargetTemplate = template.Must( template.New("target-template"). Funcs(TemplateFuncs). Parse(defaultTargetTemplateString)) TemplateFuncs = template.FuncMap{ "host": utils.GetHost, } )
View Source
var OutputTypes = map[string]struct{}{
"file": {},
"influxdb": {},
"kafka": {},
"nats": {},
"prometheus": {},
"prometheus_write": {},
"stan": {},
"tcp": {},
"udp": {},
"gnmi": {},
"jetstream": {},
"snmp": {},
"asciigraph": {},
}
View Source
var Outputs = map[string]Initializer{}
Functions ¶
func AddSubscriptionTarget ¶
func DecodeConfig ¶
func DecodeConfig(src, dst interface{}) error
func Marshal ¶
func Marshal(pmsg protoreflect.ProtoMessage, meta map[string]string, mo *formatters.MarshalOptions, splitEvents bool, evps ...formatters.EventProcessor) ([][]byte, error)
func Register ¶
func Register(name string, initFn Initializer)
Types ¶
type BaseOutput ¶ added in v0.42.1
type BaseOutput struct {
}
func (*BaseOutput) Close ¶ added in v0.42.1
func (b *BaseOutput) Close() error
func (*BaseOutput) RegisterMetrics ¶ added in v0.42.1
func (b *BaseOutput) RegisterMetrics(*prometheus.Registry)
func (*BaseOutput) String ¶ added in v0.42.1
func (b *BaseOutput) String() string
func (*BaseOutput) WriteEvent ¶ added in v0.42.1
func (b *BaseOutput) WriteEvent(context.Context, *formatters.EventMsg)
type Initializer ¶
type Initializer func() Output
type Option ¶
type Option func(*OutputOptions) error
func WithClusterName ¶
func WithEventProcessors ¶
func WithLogger ¶
func WithRegistry ¶
func WithRegistry(reg *prometheus.Registry) Option
func WithTargetsConfig ¶
func WithTargetsConfig(tcs map[string]*types.TargetConfig) Option
type OutputOptions ¶ added in v0.42.1
Click to show internal directories.
Click to hide internal directories.