streams

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DedupeFilter

func DedupeFilter(logger kitlog.Logger, in <-chan *mvccpb.KeyValue) <-chan *mvccpb.KeyValue

DedupeFilter creates a new channel from `in` that emits events provided the value is changed from what was previously seen for that key.

func RetryFold

func RetryFold(logger kitlog.Logger, in <-chan *mvccpb.KeyValue, opt RetryFoldOptions, op Operation) error

RetryFold consumes all kvs from the `in` channel and attempts to run an operation on them, retrying that operation ad-infinitum in case of errors.

func RevisionFilter

func RevisionFilter(logger kitlog.Logger, in <-chan *mvccpb.KeyValue) <-chan *mvccpb.KeyValue

RevisionFilter creates a new channel from `in` that emits every received event, provided it preserves ordering of kv ModRevision values on a per-key basis.

func Tap

func Tap(in <-chan *mvccpb.KeyValue, op func(*mvccpb.KeyValue)) <-chan *mvccpb.KeyValue

Tap intercepts the given channel and passes values into an operation function.

Types

type Filter

type Filter func(kitlog.Logger, <-chan *mvccpb.KeyValue) <-chan *mvccpb.KeyValue

type Operation

type Operation func(context.Context, *mvccpb.KeyValue) error

type RetryFoldOptions

type RetryFoldOptions struct {
	Ctx      context.Context
	Interval time.Duration
	Timeout  time.Duration
}

RetryFoldOptions provides configuration to the RetryFold function

Jump to

Keyboard shortcuts

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