store

package
v0.0.0-...-5ef962b Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyExist error returns when Add attempts to add already existing item
	ErrAlreadyExist = errors.New("already exists")
	// ErrNotFound error returns when Get attempts to get a non existing item
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Manager

type Manager interface {
	Add(Storable) error
	Remove(string) error
	List() []Storable
	Get(string) Storable
	Stop()
}

func NewStore

func NewStore() Manager

NewStore returns a new instance of a store, any object which is compatible with the interface Storable, can be stored in the store.

type Storable

type Storable interface {
	Key() string
}

Jump to

Keyboard shortcuts

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