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 Initializer
- type Meta
- type Option
- func WithClusterName(name string) Option
- func WithEventProcessors(eps map[string]map[string]interface{}, log *log.Logger, ...) 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 ProtoMsg
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultTargetTemplate = template.Must( template.New("target-template"). Funcs(TemplateFuncs). Parse(defaultTargetTemplateString)) )
View Source
var OutputTypes = map[string]struct{}{
"file": {},
"influxdb": {},
"kafka": {},
"nats": {},
"prometheus": {},
"prometheus_write": {},
"stan": {},
"tcp": {},
"udp": {},
"gnmi": {},
"jetstream": {},
"snmp": {},
}
View Source
var Outputs = map[string]Initializer{}
View Source
var TemplateFuncs = template.FuncMap{ "host": utils.GetHost, }
Functions ¶
func AddSubscriptionTarget ¶
func DecodeConfig ¶
func DecodeConfig(src, dst interface{}) error
func Marshal ¶ added in v0.30.0
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 Initializer ¶
type Initializer func() Output
type Option ¶
type Option func(Output)
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 Output ¶
type Output interface { Init(context.Context, string, map[string]interface{}, ...Option) error Write(context.Context, proto.Message, Meta) WriteEvent(context.Context, *formatters.EventMsg) Close() error RegisterMetrics(*prometheus.Registry) String() string SetLogger(*log.Logger) SetEventProcessors(map[string]map[string]interface{}, *log.Logger, map[string]*types.TargetConfig, map[string]map[string]interface{}) SetName(string) SetClusterName(string) SetTargetsConfig(map[string]*types.TargetConfig) }
Click to show internal directories.
Click to hide internal directories.