filepiece

package
v0.0.0-...-13d4fa3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PieceStore

type PieceStore struct {
	*sync.RWMutex

	Overall *TorrentStore
	Hash    metainfo.Hash
	Length  int64
	// contains filtered or unexported fields
}

func (*PieceStore) Completion

func (ps *PieceStore) Completion() storage.Completion

func (*PieceStore) MarkComplete

func (ps *PieceStore) MarkComplete() error

func (*PieceStore) MarkNotComplete

func (ps *PieceStore) MarkNotComplete() error

func (*PieceStore) ReadAt

func (ps *PieceStore) ReadAt(b []byte, n int64) (int, error)

func (*PieceStore) WriteAt

func (ps *PieceStore) WriteAt(b []byte, off int64) (int, error)

type Store

type Store struct {
	ParentDir string
}

Store implements the ClientImpl interface of package anacrolix/torrent/storage. It abstracts a parent directory with a subdirectory for each TorrentStore

func NewStore

func NewStore(datadir string) (*Store, error)

func (*Store) Close

func (f *Store) Close() error

func (*Store) OpenTorrent

func (f *Store) OpenTorrent(info *metainfo.Info, infoHash metainfo.Hash) (storage.TorrentImpl, error)

type TorrentStore

type TorrentStore struct {
	sync.RWMutex

	DataDir string
	// contains filtered or unexported fields
}

TorrentStore implements the TorrentImpl interface of package anacrolix/torrent/storage. It stores torrent pieces as individual files in a directory named by the torrent hash.

func NewTorrentStore

func NewTorrentStore(parentDir string, infoHashStr string) (*TorrentStore, error)

func (*TorrentStore) Close

func (f *TorrentStore) Close() error

func (*TorrentStore) NewPieceStoreHashLen

func (f *TorrentStore) NewPieceStoreHashLen(hash metainfo.Hash, leng int64) *PieceStore

func (*TorrentStore) Piece

Jump to

Keyboard shortcuts

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