cidprimary

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: Apache-2.0, MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const CIDSizePrefix = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type CIDPrimary

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

A primary storage that is CID aware.

func Open added in v0.2.0

func Open(path string) (*CIDPrimary, error)

func (*CIDPrimary) Close

func (cp *CIDPrimary) Close() error

Close calls Flush to write work and data to the primary file, and then closes the file.

func (*CIDPrimary) Flush

func (cp *CIDPrimary) Flush() (types.Work, error)

Flush writes outstanding work and buffered data to the primary file.

func (*CIDPrimary) Get

func (cp *CIDPrimary) Get(blk types.Block) ([]byte, []byte, error)

func (*CIDPrimary) GetIndexKey

func (cp *CIDPrimary) GetIndexKey(blk types.Block) ([]byte, error)

func (*CIDPrimary) IndexKey

func (cp *CIDPrimary) IndexKey(key []byte) ([]byte, error)

func (*CIDPrimary) Iter

func (*CIDPrimary) OutstandingWork

func (cp *CIDPrimary) OutstandingWork() types.Work

func (*CIDPrimary) Put

func (cp *CIDPrimary) Put(key []byte, value []byte) (types.Block, error)

func (*CIDPrimary) StorageSize added in v0.2.0

func (cp *CIDPrimary) StorageSize() (int64, error)

func (*CIDPrimary) Sync

func (cp *CIDPrimary) Sync() error

Sync commits the contents of the primary file to disk. Flush should be called before calling Sync.

type CIDPrimaryIter

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

func NewCIDPrimaryIter

func NewCIDPrimaryIter(reader *os.File) *CIDPrimaryIter

func (*CIDPrimaryIter) Next

func (cpi *CIDPrimaryIter) Next() ([]byte, []byte, error)

Jump to

Keyboard shortcuts

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