memory

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

Memory provides storage mechanism for store.EventStore. It stores events in a local memory.

func New

func New(ttl time.Duration) *Memory

New returns a new instance of Memory. The ttl argument specifies how long messages should be kept in storage.

func (*Memory) Add

func (m *Memory) Add(_ context.Context, author []byte, evt *messages.Event) (bool, error)

Add implements the store.Storage interface.

func (*Memory) Get

func (m *Memory) Get(_ context.Context, typ string, idx []byte) ([]*messages.Event, error)

Get implements the store.Storage interface.

Jump to

Keyboard shortcuts

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