metainfo

package
v0.0.0-...-259e751 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo interface{}

type MIFile

type MIFile struct {
	Length int      `bencode:"length"`
	MD5Sum string   `bencode:"md5sum,omitempty"`
	Path   []string `bencode:"path"`
}

type Metainfo

type Metainfo struct {
	Info         FileInfo
	InfoBytes    bencode.Bytes `bencode:"info"`
	Announce     string        `bencode:"announce"`
	AnnounceList [][]string    `bencode:"announce-list,omitempty"`
	CreationDate int           `bencode:"creation date,omitempty"`
	Comment      string        `bencode:"comment,omitempty"`
	CreatedBy    string        `bencode:"created by,omitempty"`
	Encoding     string        `bencode:"encoding,omitempty"`
}

func Load

func Load(name string) (*Metainfo, error)

func (*Metainfo) InfoHash

func (mi *Metainfo) InfoHash() [sha1.Size]byte

type MultiFileInfo

type MultiFileInfo struct {
	PieceLength int      `bencode:"piece length"`
	Pieces      []byte   `bencode:"pieces"`
	Private     int      `bencode:"private,omitempty"`
	Name        string   `bencode:"name"`
	Files       []MIFile `bencode:"files"`
}

type SingleFileInfo

type SingleFileInfo struct {
	PieceLength int    `bencode:"piece length"`
	Pieces      []byte `bencode:"pieces"`
	Private     int    `bencode:"private,omitempty"`
	Name        string `bencode:"name"`
	Length      int    `bencode:"length"`
	MD5Sum      string `bencode:"md5sum,omitempty"`
}

Jump to

Keyboard shortcuts

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