metainfo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedProtocol = errors.New("unsupported protocol")
)

Functions

This section is empty.

Types

type FileEntry added in v0.2.0

type FileEntry struct {
	Length int      `mapstructure:"length"`
	Path   []string `mapstructure:"path"`
}

type Info

type Info struct {
	Length      int         `mapstructure:"length"`
	Files       []FileEntry `mapstructure:"files"`
	Name        string      `mapstructure:"name"`
	PieceLength int         `mapstructure:"piece length"`
	Pieces      string      `mapstructure:"pieces"`
}

type Metainfo

type Metainfo struct {
	Announce  string `mapstructure:"announce"`
	Info      Info   `mapstructure:"info"`
	InfoHash  []byte
	Multifile bool
}

func Parse

func Parse(r io.Reader) (*Metainfo, error)

Parse parses a stream into Metainfo

func (*Metainfo) PieceHashes

func (m *Metainfo) PieceHashes() [][]byte

PieceHashes returns a hash slice of pieces in a file

Jump to

Keyboard shortcuts

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