store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDisabled = errors.New("state tracking is disabled")
View Source
var ErrIdInvalid = errors.New("id is invalid")
View Source
var ErrNotFound = errors.New("entity not found")

Functions

This section is empty.

Types

type Store

type Store[T any] interface {
	// Is the state usable
	Usable() bool

	// Get an entity from the state
	Get(id string) (*T, error)

	// Set an entity in the state
	Set(id string, entity *T) error

	// Delete an entity from the state
	Delete(id string) error

	// Returns the length of the store
	Length() int
}

To allow for alternative storage implementations

store provides an interface for caching and storing state for a Revolt client

Stores manage the entire read/write mechanism of state *but not the actual caching implementation*

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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