store

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyExists      = errors.New("store: key already exists")
	ErrKeyDoesntExist = errors.New("store: key does not exist")
)

Functions

This section is empty.

Types

type MemStore

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

func (*MemStore) Delete

func (m *MemStore) Delete(key string) error

func (*MemStore) Get

func (m *MemStore) Get(key string) (interface{}, error)

func (*MemStore) Set

func (m *MemStore) Set(key string, value interface{}) error

func (*MemStore) Update

func (m *MemStore) Update(key string, value interface{}) error

type Store

type Store interface {
	Set(key string, value interface{}) error
	Get(key string) (interface{}, error)
	Delete(key string) error
	Update(key string, newValue interface{}) error
}

func NewMemStore

func NewMemStore() Store

Jump to

Keyboard shortcuts

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