metainfo

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package metainfo support for reading and writing torrent files.

Index

Constants

This section is empty.

Variables

View Source
var Creator string

Functions

func NewBytes added in v0.16.0

func NewBytes(info []byte, trackers [][]string, webseeds []string, comment string) ([]byte, error)

func NewInfoBytes added in v0.16.0

func NewInfoBytes(path string, private bool, pieceLength uint32) ([]byte, error)

Types

type File added in v0.16.0

type File struct {
	Length int64
	Path   string
}

type Info

type Info struct {
	PieceLength uint32
	Name        string
	Hash        [20]byte
	Length      int64
	NumPieces   uint32
	Bytes       []byte
	Private     bool
	Files       []File
	// contains filtered or unexported fields
}

Info contains information about torrent.

func NewInfo

func NewInfo(b []byte) (*Info, error)

NewInfo returns info from bencoded bytes in b.

func (*Info) PieceHash added in v0.16.0

func (i *Info) PieceHash(index uint32) []byte

type MetaInfo

type MetaInfo struct {
	Info         Info
	AnnounceList [][]string
	URLList      []string
}

MetaInfo file dictionary

func New

func New(r io.Reader) (*MetaInfo, error)

New returns a torrent from bencoded stream.

Jump to

Keyboard shortcuts

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