storage

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventStore

type EventStore interface {
	ListSourcesByKey(ctx context.Context, key string) ([]string, error)
	LookUp(ctx context.Context, key, source string) (*event.Message, error)
	LookUpByKey(ctx context.Context, key string) ([]*event.Message, error)
	Persist(ctx context.Context, key, source, content string) error
}

EventStore persists an event by key & source, and looks up an event by key+source, or a collection of events by key.

type InMemoryStore

type InMemoryStore map[string]map[string]string // key -> source -> content

func NewInMemoryStore

func NewInMemoryStore() *InMemoryStore

func (*InMemoryStore) ListSourcesByKey

func (i *InMemoryStore) ListSourcesByKey(_ context.Context, key string) ([]string, error)

func (*InMemoryStore) LookUp

func (i *InMemoryStore) LookUp(_ context.Context, key, source string) (*event.Message, error)

func (*InMemoryStore) LookUpByKey

func (i *InMemoryStore) LookUpByKey(_ context.Context, key string) ([]*event.Message, error)

func (*InMemoryStore) Persist

func (i *InMemoryStore) Persist(_ context.Context, key, source, content string) error

Jump to

Keyboard shortcuts

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