cachedpiece

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedPiece

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

CachedPiece is a wrapper around a piece.Piece object that is capable of reading the data from a picecache.Cache.

func New

func New(pi *piece.Piece, cache *piececache.Cache, readSize int64, peerID [20]byte) *CachedPiece

New returns a new CachedPiece object. Reads are done with blocks of `readSize`.

func (*CachedPiece) ReadAt

func (c *CachedPiece) ReadAt(p []byte, off int64) (n int, err error)

ReadAt implements the io.ReaderAt interface.

Jump to

Keyboard shortcuts

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