Documentation ¶
Index ¶
- func IterateChunkEntries(st storage.Store, fn func(swarm.Address, bool) (bool, error)) error
- func IterateLocations(ctx context.Context, st storage.Store, locationResultC chan<- LocationResult)
- type ChunkStoreWrapper
- func (c *ChunkStoreWrapper) Close() error
- func (c *ChunkStoreWrapper) Delete(ctx context.Context, addr swarm.Address) error
- func (c *ChunkStoreWrapper) Get(ctx context.Context, addr swarm.Address) (swarm.Chunk, error)
- func (c *ChunkStoreWrapper) Has(_ context.Context, addr swarm.Address) (bool, error)
- func (c *ChunkStoreWrapper) Iterate(ctx context.Context, fn storage.IterateChunkFn) error
- func (c *ChunkStoreWrapper) Put(ctx context.Context, ch swarm.Chunk) error
- type LocationResult
- type Sharky
- type TxChunkStoreWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IterateChunkEntries ¶
func IterateLocations ¶
func IterateLocations( ctx context.Context, st storage.Store, locationResultC chan<- LocationResult, )
IterateLocations iterates over entire retrieval index and plucks only sharky location.
Types ¶
type ChunkStoreWrapper ¶
type ChunkStoreWrapper struct {
// contains filtered or unexported fields
}
func (*ChunkStoreWrapper) Close ¶
func (c *ChunkStoreWrapper) Close() error
func (*ChunkStoreWrapper) Iterate ¶
func (c *ChunkStoreWrapper) Iterate(ctx context.Context, fn storage.IterateChunkFn) error
type LocationResult ¶
type Sharky ¶
type Sharky interface { Read(context.Context, sharky.Location, []byte) error Write(context.Context, []byte) (sharky.Location, error) Release(context.Context, sharky.Location) error }
Sharky provides an abstraction for the sharky.Store operations used in the chunkstore. This allows us to be more flexible in passing in the sharky instance to chunkstore. For eg, check the TxChunkStore implementation in this pkg.
type TxChunkStoreWrapper ¶
type TxChunkStoreWrapper struct { *storage.TxChunkStoreBase // contains filtered or unexported fields }
func NewTxChunkStore ¶
func NewTxChunkStore(txStore storage.TxStore, csSharky Sharky) *TxChunkStoreWrapper
func (*TxChunkStoreWrapper) Commit ¶
func (cs *TxChunkStoreWrapper) Commit() error
func (*TxChunkStoreWrapper) NewTx ¶
func (cs *TxChunkStoreWrapper) NewTx(state *storage.TxState) storage.TxChunkStore
func (*TxChunkStoreWrapper) Recover ¶
func (cs *TxChunkStoreWrapper) Recover() error
Recover attempts to recover from a previous crash by reverting all uncommitted transactions.
func (*TxChunkStoreWrapper) Rollback ¶
func (cs *TxChunkStoreWrapper) Rollback() error
Click to show internal directories.
Click to hide internal directories.