torrentfile

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package torrentfile reads the little a scanner needs from .torrent files: name, total size, file count and the infohash. It carries its own minimal bencode walker instead of a BitTorrent dependency — the infohash is the SHA-1 of the raw bytes of the top-level "info" value, so the walker tracks byte ranges while decoding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Path       string `json:"path"`
	Name       string `json:"name"`
	InfoHash   string `json:"infohash"`
	Size       int64  `json:"size"`
	FilesCount int    `json:"files_count"`
}

Info is what Parse extracts from a .torrent file.

func Parse

func Parse(path string) (*Info, error)

Parse reads and parses one .torrent file.

func ParseBytes

func ParseBytes(path string, b []byte) (*Info, error)

ParseBytes parses .torrent content.

Jump to

Keyboard shortcuts

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