torrent

package
v0.0.0-...-c899e52 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2015 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBitCometKey

func GetBitCometKey(info_hash string) string

get Bitcomet key with info_hash

Types

type BitTorrent

type BitTorrent struct {
	Info_hash    string
	DownloadLink string
}

BitTorrent

func New

func New(info_hash string) *BitTorrent

new BitTorrent

func (*BitTorrent) GetTorrentMetaInfo

func (b *BitTorrent) GetTorrentMetaInfo() (*MetaInfo, error)

get torrent meta info.

func (*BitTorrent) ReadTorrentInformation

func (b *BitTorrent) ReadTorrentInformation(r io.Reader) (*MetaInfo, error)

Read torrent information

type DirectoryInfo

type DirectoryInfo struct {
	Name  string
	Dirs  []*DirectoryInfo
	Files []*File
}

directory information

type File

type File struct {
	Path   string // file path
	Length int64  // file length
}

File

type FileDict

type FileDict struct {
	Length uint64
	Path   []string
	Md5sum string `bencode:"md5sum"`
}

torrent file information

type InfoDict

type InfoDict struct {
	Files  []FileDict // multiple files.
	Name   string
	Length uint64 `bencode:"length"`
	Md5sum string

	PieceLength  uint64 `bencode:"piece length"`
	Pieces       string `bencode:"pieces"`
	Publisher    string `bencode:"publisher"`
	PublisherURL string `bencode:"publisher-url"`
}

torrent info section

type MetaInfo

type MetaInfo struct {
	InfoHash   string
	Announce   string
	CreateDate int64  `bencode:"creation date"`
	Comment    string `bencode:"comment"`
	Encoding   string `bencode:"encoding"`

	Info InfoDict
}

torrent information

Jump to

Keyboard shortcuts

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