block_rpc_client

package
v0.56.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockStore

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

BlockStore implements a BlockStore backed by a BlockStore service.

func NewBlockStore

func NewBlockStore(
	client block_rpc.SRPCBlockStoreClient,
	hashType hash.HashType,
	readOnly bool,
) *BlockStore

NewBlockStore constructs a new BlockStore.

func (*BlockStore) BeginReadOperation added in v0.51.7

func (v *BlockStore) BeginReadOperation(context.Context) (block.StoreOps, func(), error)

BeginReadOperation returns the remote store as the scoped read handle.

func (*BlockStore) GetBlock

func (v *BlockStore) GetBlock(ctx context.Context, ref *block.BlockRef) ([]byte, bool, error)

GetBlock gets a block with a cid reference. The ref should not be modified or retained by GetBlock. Note: the block may not be in the specified bucket.

func (*BlockStore) GetBlockExists

func (v *BlockStore) GetBlockExists(ctx context.Context, ref *block.BlockRef) (bool, error)

GetBlockExists checks if a block exists with a cid reference. The ref should not be modified or retained by GetBlock. Note: the block may not be in the specified bucket.

func (*BlockStore) GetBlockExistsBatch

func (v *BlockStore) GetBlockExistsBatch(ctx context.Context, refs []*block.BlockRef) ([]bool, error)

GetBlockExistsBatch requests a remote batch existence check.

func (*BlockStore) GetHashType

func (v *BlockStore) GetHashType() hash.HashType

GetHashType returns the preferred hash type for the store. This should return as fast as possible (called frequently). If 0 is returned, uses a default defined by Hydra.

func (*BlockStore) GetSupportedFeatures

func (v *BlockStore) GetSupportedFeatures() block.StoreFeature

GetSupportedFeatures returns the native feature bitmask for the remote store. The result is cached after the first call: the remote feature set is static for the lifetime of the store, and this method is on the hot path.

func (*BlockStore) PutBlock

func (v *BlockStore) PutBlock(ctx context.Context, data []byte, opts *block.PutOpts) (*block.BlockRef, bool, error)

PutBlock puts a block into the store. The ref should not be modified after return. The second return value can optionally indicate if the block already existed.

func (*BlockStore) PutBlockBatch

func (v *BlockStore) PutBlockBatch(ctx context.Context, entries []*block.PutBatchEntry) error

PutBlockBatch requests a remote batch write.

func (*BlockStore) RmBlock

func (v *BlockStore) RmBlock(ctx context.Context, ref *block.BlockRef) error

RmBlock deletes a block from the bucket. Does not return an error if the block was not present. In some cases, will return before confirming delete.

func (*BlockStore) StatBlock

func (v *BlockStore) StatBlock(ctx context.Context, ref *block.BlockRef) (*block.BlockStat, error)

StatBlock returns metadata about a block without reading its data. Falls back to GetBlockExists and returns Size=-1 (unknown). Returns nil, nil if the block does not exist.

func (*BlockStore) Sync added in v0.52.0

func (v *BlockStore) Sync(ctx context.Context) (bool, error)

Sync requests a remote durability barrier and reports whether it fenced.

Jump to

Keyboard shortcuts

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