Documentation
¶
Index ¶
- type BlockStore
- func (v *BlockStore) BeginReadOperation(context.Context) (block.StoreOps, func(), error)
- func (v *BlockStore) GetBlock(ctx context.Context, ref *block.BlockRef) ([]byte, bool, error)
- func (v *BlockStore) GetBlockExists(ctx context.Context, ref *block.BlockRef) (bool, error)
- func (v *BlockStore) GetBlockExistsBatch(ctx context.Context, refs []*block.BlockRef) ([]bool, error)
- func (v *BlockStore) GetHashType() hash.HashType
- func (v *BlockStore) GetSupportedFeatures() block.StoreFeature
- func (v *BlockStore) PutBlock(ctx context.Context, data []byte, opts *block.PutOpts) (*block.BlockRef, bool, error)
- func (v *BlockStore) PutBlockBatch(ctx context.Context, entries []*block.PutBatchEntry) error
- func (v *BlockStore) RmBlock(ctx context.Context, ref *block.BlockRef) error
- func (v *BlockStore) StatBlock(ctx context.Context, ref *block.BlockRef) (*block.BlockStat, error)
- func (v *BlockStore) Sync(ctx context.Context) (bool, error)
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
BeginReadOperation returns the remote store as the scoped read handle.
func (*BlockStore) GetBlock ¶
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 ¶
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 ¶
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.