Documentation ¶
Overview ¶
Package storage provides interface and default implementation of storage as map for objects.
Usage:
s := NewMapStorage() obj := &BaseObject{} key := s.Set(obj) s.Get(key) s.GetKey()
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapStorage ¶
type MapStorage struct {
// contains filtered or unexported fields
}
MapStorage is Storage interface implementation with map as place for store.
func NewMapStorage ¶
func NewMapStorage() *MapStorage
NewMapStorage creates new MapStorage instance with empty storage.
func (*MapStorage) Get ¶
func (m *MapStorage) Get(record string) (interface{}, error)
Get restore object from storage.
func (*MapStorage) GetKeys ¶
func (m *MapStorage) GetKeys() []string
GetKeys gives list of all keys in storage.
func (*MapStorage) Set ¶
func (m *MapStorage) Set(obj interface{}) (string, error)
Set store object into storage.
Click to show internal directories.
Click to hide internal directories.