IConly

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: GPL-2.0, MIT Imports: 10 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 {
	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.

Jump to

Keyboard shortcuts

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