inmemchunkstore

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkStore

type ChunkStore struct {
	// contains filtered or unexported fields
}

func New

func New() *ChunkStore

func (*ChunkStore) Close

func (c *ChunkStore) Close() error

func (*ChunkStore) Delete

func (c *ChunkStore) Delete(_ context.Context, addr swarm.Address) error

func (*ChunkStore) Get

func (c *ChunkStore) Get(_ context.Context, addr swarm.Address) (swarm.Chunk, error)

func (*ChunkStore) Has

func (c *ChunkStore) Has(_ context.Context, addr swarm.Address) (bool, error)

func (*ChunkStore) Iterate

func (*ChunkStore) Put

func (c *ChunkStore) Put(_ context.Context, ch swarm.Chunk) error

type TxChunkStore

type TxChunkStore struct {
	*storage.TxChunkStoreBase
	// contains filtered or unexported fields
}

TxChunkStore is an implementation of in-memory Store where all Store operations are done in a transaction.

func NewTxChunkStore

func NewTxChunkStore(store storage.ChunkStore) *TxChunkStore

NewTxChunkStore returns a new TxChunkStore instance backed by the given chunk store.

func (*TxChunkStore) Commit

func (s *TxChunkStore) Commit() error

Commit implements the Tx interface.

func (*TxChunkStore) Delete

func (s *TxChunkStore) Delete(ctx context.Context, addr swarm.Address) error

Delete implements the Store interface.

func (*TxChunkStore) NewTx

func (s *TxChunkStore) NewTx(state *storage.TxState) storage.TxChunkStore

NewTx implements the TxStore interface.

func (*TxChunkStore) Put

func (s *TxChunkStore) Put(ctx context.Context, chunk swarm.Chunk) (err error)

Put implements the Store interface.

func (*TxChunkStore) Rollback

func (s *TxChunkStore) Rollback() error

Rollback implements the Tx interface.

Jump to

Keyboard shortcuts

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