Documentation ¶
Index ¶
- Constants
- Variables
- type Ledger
- type PersistentStorageApi
- type PersistentStorageIteratorApi
- type PersistentStorageProvider
- type PersistentStorageTransactionApi
- type Registry
- type ReplayHandler
- type Store
- func (s *Store) Close() error
- func (s *Store) DeleteKey(key string) error
- func (s *Store) MakeKey(registry Registry, id string) string
- func (s *Store) NewKey(key string, metadata []byte) (*Ledger, error)
- func (s *Store) OpenKey(key string) (*Ledger, error)
- func (s *Store) Register(registries []Registry)
- func (s *Store) Replay() error
Constants ¶
View Source
const (
KeyPrefixLength = 2
)
Variables ¶
View Source
var ErrRegistryNotFound = errors.New("registry not found")
View Source
var StorageProvider = NewLocalPersistentStorageProvider()
Functions ¶
This section is empty.
Types ¶
type PersistentStorageApi ¶
type PersistentStorageApi interface { View(func(txn PersistentStorageTransactionApi) error) error Update(func(txn PersistentStorageTransactionApi) error) error Delete(key string) error Close() error }
Persistent Storage API provides an interface for interacting with persistent storage
type PersistentStorageIteratorApi ¶
type PersistentStorageIteratorApi interface { Rewind() Valid() bool Next() Key() string Value() ([]byte, error) Close() }
Persistent Storage Iterator API provides an iterface for interacting with persistent storage iterators
type PersistentStorageProvider ¶
type PersistentStorageProvider interface {
NewPersistentStorageInterface(path string, readOnly bool) (PersistentStorageApi, error)
}
func NewJsonFilePersistentStorageProvider ¶
func NewJsonFilePersistentStorageProvider(filename string) PersistentStorageProvider
func NewLocalPersistentStorageProvider ¶
func NewLocalPersistentStorageProvider() PersistentStorageProvider
type PersistentStorageTransactionApi ¶
type PersistentStorageTransactionApi interface { NewIterator(prefix string) PersistentStorageIteratorApi Set(key string, value []byte) error Get(key string) ([]byte, error) }
Persistent Storage Transaction API provides an interface for interacting with persistent storage transactions
func NewBase64PersistentStorageTransaction ¶
func NewBase64PersistentStorageTransaction(data map[string]string) PersistentStorageTransactionApi
type Registry ¶
type Registry interface { Prefix() string NewReplay(id string) ReplayHandler }
type ReplayHandler ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.