stream

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 7 Imported by: 13

Documentation

Index

Constants

View Source
const BATCH_SIZE = 5000 //5000 is an arbitrary number, should probably be based on something else.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptoKeyProvider

type CryptoKeyProvider func(key string) string

type Filter

type Filter[MT any] func(md event.Metadata[MT]) bool

func ReadAll

func ReadAll[MT any]() Filter[MT]

func ReadDataType added in v0.3.1

func ReadDataType[MT any](t string) Filter[MT]

func ReadEventType added in v0.3.1

func ReadEventType[MT any](t event.Type) Filter[MT]

type Persistence

type Persistence interface {
	Store(streamName string, ctx context.Context, events ...store.Event) (transactionId uint64, err error)
	Stream(streamName string, from store.StreamPosition, ctx context.Context) (out <-chan store.Event, err error)
}

type Stream

type Stream[DT, MT any] interface {
	Store(event event.Event[DT, MT], cryptoKey CryptoKeyProvider) (transactionId uint64, err error)
	Stream(eventTypes []event.Type, from store.StreamPosition, filter Filter[MT], cryptKey CryptoKeyProvider, ctx context.Context) (out <-chan event.Event[DT, MT], err error)
	Name() string
}

func Init

func Init[DT, MT any](st Persistence, stream string, ctx context.Context) (out Stream[DT, MT], err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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