freelist

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CIDSizePrefix = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type FreeList

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

A primary storage that is CID aware.

func OpenFreeList

func OpenFreeList(path string) (*FreeList, error)

func (*FreeList) Close

func (cp *FreeList) Close() error

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

func (*FreeList) Flush

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

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

func (*FreeList) Iter

func (cp *FreeList) Iter() (*FreeListIter, error)

func (*FreeList) OutstandingWork

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

func (*FreeList) Put

func (cp *FreeList) Put(blk types.Block) error

func (*FreeList) Sync

func (cp *FreeList) Sync() error

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

type FreeListIter

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

func NewFreeListIter

func NewFreeListIter(reader *os.File) *FreeListIter

func (*FreeListIter) Next

func (cpi *FreeListIter) Next() (*types.Block, error)

Jump to

Keyboard shortcuts

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