sink

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSink

func RegisterSink(name config.SinkType, provider Provider) bool

RegisterSink registers a config.SinkType to a Provider implementation which creates the Sink when requested

Types

type Context

type Context interface {
	SetTransientAttribute(key string, value string)
	TransientAttribute(key string) (value string, present bool)
	SetAttribute(key string, value string)
	Attribute(key string) (value string, present bool)
}

type Provider

type Provider = func(config *config.Config) (Sink, error)

type Sink

type Sink interface {
	Start() error
	Stop() error
	Emit(context Context, timestamp time.Time, topicName string, key, envelope schema.Struct) error
}

func NewSink

func NewSink(name config.SinkType, config *config.Config) (Sink, error)

NewSink instantiates a new instance of the requested Sink when available, otherwise returns an error.

type SinkFunc

type SinkFunc func(context Context, timestamp time.Time, topicName string, key, envelope schema.Struct) error

func (SinkFunc) Emit

func (sf SinkFunc) Emit(context Context, timestamp time.Time, topicName string, key, envelope schema.Struct) error

func (SinkFunc) Start

func (sf SinkFunc) Start() error

func (SinkFunc) Stop

func (sf SinkFunc) Stop() error

Jump to

Keyboard shortcuts

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