memory

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RawEventRowUint

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

type StorageMemory

type StorageMemory struct {
	Db    *memdb.MemDB
	Index *uint32
}

func Init

func Init() *StorageMemory

func (StorageMemory) AddEventRow

func (s StorageMemory) AddEventRow(payload payload.Payload) bool

AddEventRow adds a new event to the database.

As entries are not auto-incremeneting the id is incremented manually which means inserts are capped at a maximum of 4294967295. If the Index hits this value it rolls over back to 0.

Due to (https://github.com/hashicorp/go-memdb/issues/7) events will get overwritten once past this point as Uniqueness is not observed.

func (StorageMemory) DeleteAllEventRows

func (s StorageMemory) DeleteAllEventRows() int64

DeleteAllEventRows removes all rows within the memory store

func (StorageMemory) DeleteEventRows

func (s StorageMemory) DeleteEventRows(ids []int) int64

DeleteEventRows removes all rows with matching identifiers

func (StorageMemory) GetAllEventRows

func (s StorageMemory) GetAllEventRows() []storageiface.EventRow

GetAllEventRows returns all rows within the memory store

func (StorageMemory) GetEventRowsWithinRange

func (s StorageMemory) GetEventRowsWithinRange(eventRange int) []storageiface.EventRow

GetEventRowsWithinRange returns all available events or a maximal slice

Jump to

Keyboard shortcuts

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