Documentation ¶
Index ¶
- Constants
- func BlockCount(fsize int64) int
- func CalSha1(b []byte, r io.Reader) ([]byte, error)
- func CalcFileGcid(filename string) (string, error)
- func DecodeBlock(ctx context.Context, b blocks.Block) (int64, ipld.Node, error)
- func GetEtag(filename string) (etag string, err error)
- type EmptyBlockstore
- func (s *EmptyBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (s *EmptyBlockstore) DeleteBlock(context.Context, cid.Cid) error
- func (s *EmptyBlockstore) FileSHA1() []byte
- func (s *EmptyBlockstore) Get(context.Context, cid.Cid) (blocks.Block, error)
- func (s *EmptyBlockstore) GetBlockCount() int64
- func (s *EmptyBlockstore) GetFileSize() int64
- func (s *EmptyBlockstore) GetSize(context.Context, cid.Cid) (int, error)
- func (s *EmptyBlockstore) Has(context.Context, cid.Cid) (bool, error)
- func (s *EmptyBlockstore) HashOnRead(enabled bool)
- func (s *EmptyBlockstore) HeadSHA1() []byte
- func (s *EmptyBlockstore) NodeMap() map[string]blocks.Block
- func (s *EmptyBlockstore) Put(ctx context.Context, b blocks.Block) error
- func (s *EmptyBlockstore) PutMany(ctx context.Context, blocks []blocks.Block) error
- func (s *EmptyBlockstore) Reslove(cidString string, intptr *int64, currentBlockIDPtr *int) error
- func (s *EmptyBlockstore) SumWcsEtag() string
- func (s *EmptyBlockstore) SumXL() []byte
Constants ¶
View Source
const ( BLOCK_BITS = 22 // Indicate that the blocksize is 4M BLOCK_SIZE = 1 << BLOCK_BITS )
Variables ¶
This section is empty.
Functions ¶
func BlockCount ¶
func CalcFileGcid ¶
Types ¶
type EmptyBlockstore ¶
type EmptyBlockstore struct {
// contains filtered or unexported fields
}
func NewEmptyBlockstore ¶
func NewEmptyBlockstore(fileSize int64, ctx context.Context) *EmptyBlockstore
func (*EmptyBlockstore) AllKeysChan ¶
func (s *EmptyBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
AllKeysChan returns a channel from which the CIDs in the Blockstore can be read. It should respect the given context, closing the channel if it becomes Done.
func (*EmptyBlockstore) DeleteBlock ¶
func (s *EmptyBlockstore) DeleteBlock(context.Context, cid.Cid) error
func (*EmptyBlockstore) FileSHA1 ¶
func (s *EmptyBlockstore) FileSHA1() []byte
func (*EmptyBlockstore) GetBlockCount ¶
func (s *EmptyBlockstore) GetBlockCount() int64
func (*EmptyBlockstore) GetFileSize ¶
func (s *EmptyBlockstore) GetFileSize() int64
func (*EmptyBlockstore) GetSize ¶
func (s *EmptyBlockstore) GetSize(context.Context, cid.Cid) (int, error)
GetSize returns the CIDs mapped BlockSize
func (*EmptyBlockstore) HashOnRead ¶
func (s *EmptyBlockstore) HashOnRead(enabled bool)
HashOnRead specifies if every read block should be rehashed to make sure it matches its CID.
func (*EmptyBlockstore) HeadSHA1 ¶
func (s *EmptyBlockstore) HeadSHA1() []byte
func (*EmptyBlockstore) PutMany ¶
PutMany puts a slice of blocks at the same time using batching capabilities of the underlying datastore whenever possible.
func (*EmptyBlockstore) Reslove ¶
func (s *EmptyBlockstore) Reslove(cidString string, intptr *int64, currentBlockIDPtr *int) error
func (*EmptyBlockstore) SumWcsEtag ¶
func (s *EmptyBlockstore) SumWcsEtag() string
func (*EmptyBlockstore) SumXL ¶
func (s *EmptyBlockstore) SumXL() []byte
Click to show internal directories.
Click to hide internal directories.