storagemgr

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockChain = "blockchain"
	Ledger     = "ledger"
	Blockfile  = "blockfile"
	Consensus  = "consensus"
	Epoch      = "epoch"
)

Variables

This section is empty.

Functions

func ExportCachedStorageMetrics

func ExportCachedStorageMetrics()

func Initialize

func Initialize(defaultKVType string, defaultKvCacheSize int, sync bool) error

func NewCachedStorage

func NewCachedStorage(s storage.Storage, megabytesLimit int) (storage.Storage, error)

func Open

func Open(p string) (storage.Storage, error)

func OpenSpecifyType

func OpenSpecifyType(typ string, p string) (storage.Storage, error)

func ResetCachedStorageMetrics

func ResetCachedStorageMetrics()

Types

type BatchWrapper

type BatchWrapper struct {
	storage.Batch
	// contains filtered or unexported fields
}

func (*BatchWrapper) Commit

func (w *BatchWrapper) Commit()

func (*BatchWrapper) Delete

func (w *BatchWrapper) Delete(key []byte)

func (*BatchWrapper) Put

func (w *BatchWrapper) Put(key, value []byte)

type CachedStorage

type CachedStorage struct {
	storage.Storage
	// contains filtered or unexported fields
}

func (*CachedStorage) Close

func (c *CachedStorage) Close() error

func (*CachedStorage) Delete

func (c *CachedStorage) Delete(key []byte)

func (*CachedStorage) Get

func (c *CachedStorage) Get(key []byte) []byte

func (*CachedStorage) Has

func (c *CachedStorage) Has(key []byte) bool

func (*CachedStorage) NewBatch

func (c *CachedStorage) NewBatch() storage.Batch

func (*CachedStorage) Put

func (c *CachedStorage) Put(key, value []byte)

Jump to

Keyboard shortcuts

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