Versions in this module Expand all Collapse all v1 v1.1.0 Nov 5, 2020 v1.0.0 Sep 3, 2020 Changes in this version + var ErrInvalidAction = fmt.Errorf("invalid action") + var ErrKeyExists = fmt.Errorf("key already exists") + var ErrKeyNotExist = fmt.Errorf("key does not exist") + var ErrValueNotRegistered = fmt.Errorf("value not registered") + var ErrValueRegistered = fmt.Errorf("value already registered") + func ListRegisteredValues() []string + func RegisterValue(newFn func() Value) + type Action string + type DoFunc func(params ...interface{}) (interface{}, error) + type ImportOpts struct + AddKeys bool + ErrOnInvalidKey bool + UpdateTypes bool + type Schema map[string]ValueType + func (s Schema) String() string + type Store struct + func NewStore() *Store + func NewStoreFromSchema(schema Schema) (*Store, error) + func (s *Store) AddKey(key string, typ ValueType) error + func (s *Store) DeleteKey(key string) error + func (s *Store) Do(key string, action Action, params ...interface{}) (interface{}, error) + func (s *Store) Export() (json.RawMessage, error) + func (s *Store) FromJSON(key string, rawmessage json.RawMessage) error + func (s *Store) GetSchema() Schema + func (s *Store) GetValueType(key string) (ValueType, error) + func (s *Store) Import(rawmessage json.RawMessage, opts ImportOpts) error + func (s *Store) KeyExists(key string) bool + func (s *Store) ToJSON(key string) (json.RawMessage, error) + func (s *Store) UpdateKey(key string, typ ValueType) error + type StoreJSON = map[string]ValJSON + type ValJSON struct + Data json.RawMessage + Type string + type Value interface + DoMap func() map[Action]DoFunc + FromJSON func(json.RawMessage) error + ToJSON func() (json.RawMessage, error) + Type func() ValueType + type ValueType string