storage

package
v0.0.0-...-0cf3de4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2016 License: MPL-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MMapTorrent

func MMapTorrent(md *metainfo.Info, location string) (mms mmap_span.MMapSpan, err error)

Types

type I

type I interface {
	OpenTorrent(info *metainfo.InfoEx) (Torrent, error)
}

Represents data storage for an unspecified torrent.

func NewFile

func NewFile(baseDir string) I

func NewMMap

func NewMMap(baseDir string) I

func NewPieceFileStorage

func NewPieceFileStorage(fs missinggo.FileStore) I

type Piece

type Piece interface {
	// Should return io.EOF only at end of torrent. Short reads due to missing
	// data should return io.ErrUnexpectedEOF.
	io.ReaderAt
	io.WriterAt
	// Called when the client believes the piece data will pass a hash check.
	// The storage can move or mark the piece data as read-only as it sees
	// fit.
	MarkComplete() error
	// Returns true if the piece is complete.
	GetIsComplete() bool
}

Interacts with torrent piece data.

type Torrent

type Torrent interface {
	Piece(metainfo.Piece) Piece
	Close() error
}

Data storage bound to a torrent.

Jump to

Keyboard shortcuts

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