stream

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name      string
	Debug     bool
	Store     string
	Source    string
	Metrics   metrics.MetricList
	Raw       json.RawMessage
	Where     string
	WhereCond condition.Condition
}

Config of the stream

func (*Config) Condition added in v0.5.1

func (c *Config) Condition() (condition.Condition, error)

Condition of the stream

func (*Config) Decode added in v0.4.0

func (c *Config) Decode(v any) error

Decode raw data to the target object

func (*Config) UnmarshalJSON added in v0.4.0

func (c *Config) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON data

func (*Config) Validate added in v0.4.0

func (c *Config) Validate() error

Validate config object

type Option

type Option func(cnf *Config)

Option of the stream

func WithCondition added in v0.5.1

func WithCondition(cond condition.Condition) Option

WithCondition condition

func WithConfig

func WithConfig(conf *Config) Option

WithConfig custom

func WithDebug

func WithDebug(debug bool) Option

WithDebug mode

func WithMetrics added in v0.4.0

func WithMetrics(metrics metrics.MetricList) Option

WithMetrics of the stream

func WithName

func WithName(name string) Option

WithName of the stream

func WithObjectConfig

func WithObjectConfig(obj any) Option

WithObjectConfig converts Object to JSON storage config

func WithRawConfig

func WithRawConfig(raw json.RawMessage) Option

WithRawConfig storage config

func WithWhere

func WithWhere(where string) Option

WithWhere condition

type Streamer added in v0.4.0

type Streamer interface {
	// Close extension
	io.Closer

	// ID returns unical stream identificator
	ID() string

	// Put message to the stream to process information
	Put(ctx context.Context, msg message.Message) error

	// Check if message suits for the stream
	Check(ctx context.Context, msg message.Message) bool

	// Run processing loop
	Run(ctx context.Context) error
}

Streamer interface of data processing describes basic methods of data pipeline

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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