IC

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: CC0-1.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 Backend

type Backend struct {
	// Badger backend must be populated
	Badger *badger.Backend
	IC     *agent.Backend
}

func (*Backend) Close

func (b *Backend) Close()

Close the connection to the database.

func (*Backend) CountEvents

func (b *Backend) CountEvents(c context.T, f *filter.T) (count int, err error)

CountEvents returns the number of events found matching the filter.

func (*Backend) DeleteEvent

func (b *Backend) DeleteEvent(c context.T, evt *event.T) (err error)

DeleteEvent removes an event from the event store.

func (*Backend) Init

func (b *Backend) Init(inf *relayinfo.T, params ...string) (err error)

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

func (*Backend) QueryEvents

func (b *Backend) QueryEvents(c context.T, C chan *event.T,
	f *filter.T) (err error)

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 error)

SaveEvent writes an event to the event store.

func (*Backend) Serial added in v1.1.0

func (b *Backend) Serial() []byte

Serial returns the serial code for the database.

Jump to

Keyboard shortcuts

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