torsrc

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("could not find source for id")

Functions

This section is empty.

Types

type CombinedSource

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

func NewCombinedSrc

func NewCombinedSrc(list []Source) *CombinedSource

func (*CombinedSource) Lookup

func (cs *CombinedSource) Lookup(idNum uint64) (util.Range, *torrent.TorrentSpec, error)

type DirSrc

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

func NewDirSrc

func NewDirSrc(path string) DirSrc

func (DirSrc) ListAll

func (ds DirSrc) ListAll() ([]util.Range, []*torrent.TorrentSpec, error)

func (DirSrc) Lookup

func (ds DirSrc) Lookup(idNum uint64) (util.Range, *torrent.TorrentSpec, error)

type HashSrc

type HashSrc struct {
	Trackers []string
	Entries  []HashSrcEntry
	// contains filtered or unexported fields
}

func NewHashSrcFromFile

func NewHashSrcFromFile(path string, cli *torrent.Client) (*HashSrc, error)

func (*HashSrc) Lookup

func (hs *HashSrc) Lookup(idNum uint64) (util.Range, *torrent.TorrentSpec, error)

type HashSrcEntry

type HashSrcEntry struct {
	Range util.Range
	Hash  string
	Name  string
}

type Source

type Source interface {
	Lookup(idNum uint64) (util.Range, *torrent.TorrentSpec, error)
}

Jump to

Keyboard shortcuts

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