torrent

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Name  string
	Size  int64
	Files []string
	Bytes []byte
}

func GetTorrentDetails

func GetTorrentDetails(torrentUrl string, timeout int, headers req.Header) (*Data, error)

type TorrentFile

type TorrentFile struct {
	Length int64
	Path   string
}

Contains all the info about the torrent file

type TorrentInfo

type TorrentInfo struct {
	Name        string
	Length      int64
	PieceLength int64
	// Pieces      string
	Files []*TorrentFile
}

Contains all the meta-info data from the original torrent file

type TorrentMeta

type TorrentMeta struct {
	AnnounceList []string
	CreationDate time.Time
	Encoding     string
	Comment      string
	CreatedBy    string
	Info         *TorrentInfo
}

Contains all the meta-file data from the original torrent file

func TorrentDecode

func TorrentDecode(b []byte) (*TorrentMeta, error)

Decode byte-array of torrent file into TorrentMeta struct

Jump to

Keyboard shortcuts

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