mhprimary

package
v0.1.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SizePrefix = 4

Variables

This section is empty.

Functions

This section is empty.

Types

type MultihashPrimary

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

A primary storage that is multihash aware.

func OpenMultihashPrimary

func OpenMultihashPrimary(path string) (*MultihashPrimary, error)

func (*MultihashPrimary) Close

func (cp *MultihashPrimary) Close() error

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

func (*MultihashPrimary) Flush

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

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

func (*MultihashPrimary) Get

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

func (*MultihashPrimary) GetIndexKey

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

func (*MultihashPrimary) IndexKey

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

func (*MultihashPrimary) Iter

func (*MultihashPrimary) OutstandingWork

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

func (*MultihashPrimary) Put

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

func (*MultihashPrimary) Sync

func (cp *MultihashPrimary) Sync() error

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

type MultihashPrimaryIter

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

func NewMultihashPrimaryIter

func NewMultihashPrimaryIter(reader *os.File) *MultihashPrimaryIter

func (*MultihashPrimaryIter) Next

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

Jump to

Keyboard shortcuts

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