datastore

package
v0.0.0-...-3042244 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOutOfMemory          = &DataStoreError{Message: "Out of memory"}
	ErrEmptyKey             = &DataStoreError{Message: "Empty key is not allowed"}
	ErrNilValue             = &DataStoreError{Message: "Nil value is not allowed"}
	ErrKeyNotFound          = &DataStoreError{Message: "Key not found"}
	ErrDuplicateKey         = &DataStoreError{Message: "Key already exists"}
	ErrSpecialCharactersKey = &DataStoreError{Message: "Key with special characters is not allowed"}
)

Declared Errors

Functions

This section is empty.

Types

type DataStore

type DataStore struct {
	Data map[string]interface{}
	// contains filtered or unexported fields
}

func NewDataStore

func NewDataStore() *DataStore

func (*DataStore) Delete

func (s *DataStore) Delete(key string) error

func (*DataStore) FlushAll

func (s *DataStore) FlushAll() error

func (*DataStore) Get

func (s *DataStore) Get(key string) (interface{}, error)

func (*DataStore) GetAll

func (s *DataStore) GetAll() map[string]interface{}

func (*DataStore) Set

func (s *DataStore) Set(key string, value interface{}) error

func (*DataStore) Update

func (s *DataStore) Update(key string, value interface{}) error

type DataStoreError

type DataStoreError struct {
	Cause   error
	Message string
}

func (*DataStoreError) Error

func (e *DataStoreError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳