outputs

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTargetTemplate = template.Must(
		template.New("target-template").
			Funcs(TemplateFuncs).
			Parse(defaultTargetTemplateString))
)
View Source
var OutputTypes = []string{
	"file",
	"influxdb",
	"kafka",
	"nats",
	"prometheus",
	"stan",
	"tcp",
	"udp",
	"gnmi",
}
View Source
var Outputs = map[string]Initializer{}
View Source
var TemplateFuncs = template.FuncMap{
	"host": utils.GetHost,
}

Functions

func AddSubscriptionTarget added in v0.15.0

func AddSubscriptionTarget(msg proto.Message, meta Meta, addTarget string, tpl *template.Template) error

func DecodeConfig added in v0.4.0

func DecodeConfig(src, dst interface{}) error

func Register

func Register(name string, initFn Initializer)

Types

type Initializer

type Initializer func() Output

type Meta

type Meta map[string]string

type Option added in v0.5.2

type Option func(Output)

func WithClusterName added in v0.8.0

func WithClusterName(name string) Option

func WithEventProcessors added in v0.6.0

func WithEventProcessors(eps map[string]map[string]interface{}, log *log.Logger, tcs map[string]*types.TargetConfig) Option

func WithLogger added in v0.5.2

func WithLogger(logger *log.Logger) Option

func WithName added in v0.7.0

func WithName(name string) Option

func WithRegister added in v0.7.0

func WithRegister(reg *prometheus.Registry) Option

func WithTargetsConfig added in v0.18.0

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)
	SetName(string)
	SetClusterName(string)
	SetTargetsConfig(map[string]*types.TargetConfig)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL