layer2

package
v1.2.26 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Unlicense Imports: 14 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

	// L1 will store its state/configuration in path/layer1
	L1 store.I
	// L2 will store its state/configuration in path/layer2
	L2 store.I
	// PollFrequency is how often the L2 is queried for recent events. This is only
	// relevant for shared layer2 stores, and will not apply for layer2
	// implementations that are just two separate data store systems on the same
	// server.
	PollFrequency time.Duration
	// PollOverlap is the multiple of the PollFrequency within which polling the L2
	// is done to ensure any slow synchrony on the L2 is covered (2-4 usually).
	PollOverlap timestamp.T
	// EventSignal triggers when the L1 saves a new event from the L2
	//
	// caller is responsible for populating this so that a signal can pass to all
	// peers sharing the same L2 and enable cross-cluster subscription delivery.
	EventSignal event.C
	// contains filtered or unexported fields
}

func (*Backend) Close

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

func (*Backend) CountEvents

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

func (*Backend) DeleteEvent

func (b *Backend) DeleteEvent(c Ctx, ev *eventid.T) (err E)

func (*Backend) Export

func (b *Backend) Export(c Ctx, w io.Writer, pubkeys ...B)

func (*Backend) Import

func (b *Backend) Import(r io.Reader)

func (*Backend) Init

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

func (*Backend) Nuke

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

func (*Backend) Path

func (b *Backend) Path() (s S)

func (*Backend) QueryEvents

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

func (*Backend) SaveEvent

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

func (*Backend) Sync

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

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