store

package
v0.0.0-...-2552c51 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallCheck

type CallCheck func(key, value any, exists bool) (rKey, rValue any, created bool)

type CallCreate

type CallCreate func(key any) (value any, created bool)

type CallCreateMulti

type CallCreateMulti func(key any) (m map[any]any, created bool)

type Store

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

func FromMap

func FromMap(m map[any]any) *Store

func New

func New() *Store

func (*Store) Clear

func (s *Store) Clear()

func (*Store) Delete

func (s *Store) Delete(key any) (any, bool)

func (*Store) DeleteMulti

func (s *Store) DeleteMulti(keys []any)

func (*Store) Each

func (s *Store) Each(callback func(any, any) bool)

Each implements a map bypass for each key using the callback function. If the callback function returns false, then the cycle stops

func (*Store) Get

func (s *Store) Get(key any) (val any, check bool)

func (*Store) GetCheck

func (s *Store) GetCheck(key any, mCheck CallCheck) (res any, check bool)

func (*Store) GetCreate

func (s *Store) GetCreate(key any, mCreate CallCreate) (res any, check bool)

func (*Store) GetCreateMulti

func (s *Store) GetCreateMulti(key any, mCreateMulti CallCreateMulti) (res any, check bool)

func (*Store) Keys

func (s *Store) Keys() (res []any)

func (*Store) Len

func (s *Store) Len() (res int)

func (*Store) Map

func (s *Store) Map() (res map[any]any)

func (*Store) Set

func (s *Store) Set(key, val any)

func (*Store) SetMulti

func (s *Store) SetMulti(m map[any]any)

type StoreString

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

func StringFromMap

func StringFromMap(m map[string]interface{}) *StoreString

func StringNew

func StringNew() *StoreString

func (*StoreString) Clear

func (s *StoreString) Clear()

func (*StoreString) Delete

func (s *StoreString) Delete(key string) (any, bool)

func (*StoreString) DeleteMulti

func (s *StoreString) DeleteMulti(keys []string)

func (*StoreString) Each

func (s *StoreString) Each(callback func(string, interface{}) bool)

Each implements a map bypass for each key using the callback function. If the callback function returns false, then the cycle stops

func (*StoreString) Get

func (s *StoreString) Get(key string) (val interface{}, check bool)

func (*StoreString) GetCheck

func (s *StoreString) GetCheck(key string, mCheck StringCallCheck) (res interface{}, check bool)

func (*StoreString) GetCreate

func (s *StoreString) GetCreate(key string, mCreate StringCallCreate) (res interface{}, check bool)

func (*StoreString) GetCreateMulti

func (s *StoreString) GetCreateMulti(key string, mCreateMulti StringCallCreateMulti) (res interface{}, check bool)

func (*StoreString) Keys

func (s *StoreString) Keys() (res []string)

func (*StoreString) Len

func (s *StoreString) Len() (res int)

func (*StoreString) Map

func (s *StoreString) Map() (res map[string]interface{})

func (*StoreString) Set

func (s *StoreString) Set(key string, val interface{})

func (*StoreString) SetMulti

func (s *StoreString) SetMulti(m map[string]interface{})

type StringCallCheck

type StringCallCheck func(key string, value interface{}, exists bool) (rKey string, rValue interface{}, created bool)

type StringCallCreate

type StringCallCreate func(key string) (value interface{}, created bool)

type StringCallCreateMulti

type StringCallCreateMulti func(key string) (map[string]interface{}, bool)

Jump to

Keyboard shortcuts

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