sink

package
v0.1.48 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnkTypeStdout = "stdout"
	SnkTypeSyslog = "syslog"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Type defines type of Sink
	Type string
	// Params contains params for the specified type
	Params Params
}

Config struct contains config for an abstract Sink.

func (*Config) Check

func (c *Config) Check() error

Check peforms an internal check of c fields

func (*Config) String

func (c *Config) String() string

String is fmt.Stringer implementation

type Params

type Params map[string]interface{}

Params a map of key-value pairs which allows to provide some settings to a Sink implementation

type Sink

type Sink interface {
	// OnEvent is called when new portion of events should be sent to the sink
	OnEvent(events []*api.LogEvent) error
	// Close is part of io.Closer
	Close() error
}

Sink interface is an abstraction for a sink implementation

func NewSink

func NewSink(cfg *Config) (Sink, error)

NewSink creates a new Sink instance by cfg provided. "stdout" and "syslog" is only supported so far

Jump to

Keyboard shortcuts

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