partialfile

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type PartialFile

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

func CreatePartialFile

func CreatePartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*PartialFile, error)

func OpenPartialFile

func OpenPartialFile(maxPieceSize abi.PaddedPieceSize, path string) (*PartialFile, error)

func (*PartialFile) Allocated

func (pf *PartialFile) Allocated() (rlepluslazy.RunIterator, error)

func (*PartialFile) Close

func (pf *PartialFile) Close() error

func (*PartialFile) Free

func (*PartialFile) HasAllocated

func (pf *PartialFile) HasAllocated(offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error)

func (*PartialFile) MarkAllocated

func (pf *PartialFile) MarkAllocated(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) error

func (*PartialFile) Reader

func (pf *PartialFile) Reader(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (io.Reader, error)

Reader forks off a new reader from the underlying file, and returns a reader starting at the given offset and reading the given size. Safe for concurrent use.

func (*PartialFile) Writer

func (pf *PartialFile) Writer(offset storiface.PaddedByteIndex, size abi.PaddedPieceSize) (io.Writer, error)

Jump to

Keyboard shortcuts

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