Documentation
¶
Index ¶
- func CreateMultiStore(name, databasesDir string, storeFactory StoreFactory) (types.MultiStore, error)
- func GenerateStoreId(name string) string
- func GenererateStorageInfo(name string, databasesDir string) (string, string)
- func IsValidStoreName(s string) bool
- func NewMultiStore(store types.Store, storeFactory StoreFactory) (types.MultiStore, error)
- type MultiStoreImpl
- func (ms *MultiStoreImpl) CreateStore(namespace string) (types.Store, bool, error)
- func (ms *MultiStoreImpl) GetStore(namespace []byte) types.Store
- func (ms *MultiStoreImpl) GetStoreCount() int
- func (ms *MultiStoreImpl) Load() (int64, error)
- func (ms *MultiStoreImpl) SaveVersion() ([]byte, int64, error)
- type StoreFactory
- type StoreFactoryImpl
- type StoreImpl
- type StoreMetaData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMultiStore ¶
func CreateMultiStore(name, databasesDir string, storeFactory StoreFactory) (types.MultiStore, error)
func GenerateStoreId ¶
func GenererateStorageInfo ¶
func IsValidStoreName ¶
func NewMultiStore ¶
func NewMultiStore(store types.Store, storeFactory StoreFactory) (types.MultiStore, error)
NewMultiStore creates a new instance of MultiStoreImpl with the provided store options.
Types ¶
type MultiStoreImpl ¶
type MultiStoreImpl struct {
types.Store // Embedding Store to satisfy the Store interface
// contains filtered or unexported fields
}
MultiStoreImpl is a concrete implementation of the MultiStore interface.
func (*MultiStoreImpl) CreateStore ¶
CreateStore creates and initializes a new store with the given namespace and options. If a store with the same namespace already exists, it returns an error.
func (*MultiStoreImpl) GetStore ¶
func (ms *MultiStoreImpl) GetStore(namespace []byte) types.Store
GetStore returns the store with the given namespace. If the store doesn't exist, it returns an error.
func (*MultiStoreImpl) GetStoreCount ¶
func (ms *MultiStoreImpl) GetStoreCount() int
GetStoreCount returns the total number of stores in the multistore.
func (*MultiStoreImpl) Load ¶
func (ms *MultiStoreImpl) Load() (int64, error)
Load loads the latest versioned database from disk.
func (*MultiStoreImpl) SaveVersion ¶
func (ms *MultiStoreImpl) SaveVersion() ([]byte, int64, error)
SaveVersion saves a new version of the database to disk.
type StoreFactory ¶
type StoreFactory interface {
// CreateStoreInternal creates a new store.
CreateStore(name string) (types.Store, error)
}
func NewStoreFactory ¶
func NewStoreFactory(databasesDir string, dbFactory db.DatabaseFactory) StoreFactory
type StoreFactoryImpl ¶
type StoreFactoryImpl struct {
// contains filtered or unexported fields
}
func (StoreFactoryImpl) CreateStore ¶
func (f StoreFactoryImpl) CreateStore(name string) (types.Store, error)
type StoreImpl ¶
type StoreImpl struct {
types.Database // Embedding Database to satisfy the Database interface
// contains filtered or unexported fields
}
StoreImpl is a concrete implementation of the Store interface.
func NewStoreImpl ¶
NewStoreImpl creates a new instance of StoreImpl with the provided StoreOptions object.
type StoreMetaData ¶
type StoreMetaData struct {
Id string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
}
StoreMetaData contains metadata for a store.