metainfo

package
v0.0.0-...-dafe3aa Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 7 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 struct {
	Length int64
	Path   []string
	Md5sum string `bencode:"md5sum,omitempty"`
}

type InfoDict

type InfoDict struct {
	PieceLength int64
	Pieces      string
	Private     int
	Name        string

	Length int64      `bencode:"length,omitempty"`
	Files  []FileInfo `bencode:"files,omitempty"`
}

type MetaInfo

type MetaInfo struct {
	Announce     string
	AnnounceList [][]string
	Comment      string
	CreatedBy    string
	CreationDate int64

	Info InfoDict

	InfoHash    [20]byte
	PieceHashes [][20]byte
	TotalLength int64
}

func LoadFromFile

func LoadFromFile(filePath string) (*MetaInfo, error)

func New

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

Jump to

Keyboard shortcuts

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