badgerbadger

package
v1.2.21 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBackend

func GetBackend(c context.T, wg *sync.WaitGroup, L1, L2 *ratel.T) (es store.I)

GetBackend returns a l2.Backend that combines two differently configured backends... the settings need to be configured in the ratel.T data structure before calling this.

Types

type B

type B = []byte

type Backend

type Backend struct {
	*layer2.Backend
}

Backend is a hybrid badger/badger eventstore where L1 will have GC enabled and L2 will not. This is mainly for testing, as both are local.

func (*Backend) Close

func (b *Backend) Close() (err E)

Close the connection to the database. IC is a request/response API authing at each request.

func (*Backend) CountEvents

func (b *Backend) CountEvents(c context.T, f *filter.T) (count N, approx bool, err E)

CountEvents returns the number of events found matching the filter.

func (*Backend) DeleteEvent

func (b *Backend) DeleteEvent(c context.T, eid *eventid.T) (err E)

DeleteEvent removes an event from the event store.

func (*Backend) Init

func (b *Backend) Init(path S) (err E)

Init sets up the badger event store and connects to the configured IC canister.

required params are address, canister ID and the badger event store size limit (which can be 0)

func (*Backend) QueryEvents

func (b *Backend) QueryEvents(c context.T, f *filter.T) (ch event.Ts, err E)

QueryEvents searches for events that match a filter and returns them asynchronously over a provided channel.

func (*Backend) SaveEvent

func (b *Backend) SaveEvent(c context.T, ev *event.T) (err E)

SaveEvent writes an event to the event store.

type Ctx

type Ctx = context.T

type E

type E = error

type N

type N = int

type S

type S = string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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