IConly

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: CC0-1.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type B

type B = []byte

type Backend

type Backend struct {
	Ctx             context.T
	WG              *sync.WaitGroup
	IC              *agent.Backend
	Inf             *relayinfo.T
	CanisterAddr    string
	CanisterId      string
	PrivateCanister bool
	SecKey          string
}

Backend is a pure Internet Computer Protocol based event store. All queries are performed to a remote data store.

func (*Backend) Close

func (b *Backend) Close()

Close the connection to the database. This is a no-op because the queries are stateless.

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. This is synchronous.

func (*Backend) DeleteEvent

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

DeleteEvent removes an event from the event store. This is synchronous.

func (*Backend) Init

func (b *Backend) Init() (err error)

Init connects to the configured IC canister.

func (*Backend) QueryEvents

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

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

This is asynchronous, it will never return an error.

func (*Backend) SaveEvent

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

SaveEvent writes an event to the event store. This is synchronous.

type E

type E = error

type N added in v0.0.14

type N = int

type S

type S = string

Jump to

Keyboard shortcuts

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