Versions in this module Expand all Collapse all v1 v1.41.2 Mar 27, 2022 Changes in this version + const HashSize + const NoName + var ParseMagnetURI = ParseMagnetUri + func GeneratePieces(r io.Reader, pieceLength int64, b []byte) ([]byte, error) + type AnnounceList [][]string + func (al AnnounceList) Clone() (ret AnnounceList) + func (al AnnounceList) DistinctValues() (ret []string) + func (al AnnounceList) OverridesAnnounce(announce string) bool + type FileInfo struct + Length int64 + Path []string + PathUtf8 []string + func (fi *FileInfo) DisplayPath(info *Info) string + func (fi FileInfo) BestPath() []string + func (me FileInfo) Offset(info *Info) (ret int64) + type Hash [HashSize]byte + func HashBytes(b []byte) (ret Hash) + func NewHashFromHex(s string) (h Hash) + func (h *Hash) FromHexString(s string) (err error) + func (h *Hash) UnmarshalText(b []byte) error + func (h Hash) AsString() string + func (h Hash) Bytes() []byte + func (h Hash) Format(f fmt.State, c rune) + func (h Hash) HexString() string + func (h Hash) MarshalText() (text []byte, err error) + func (h Hash) String() string + type Info struct + Files []FileInfo + Length int64 + Name string + NameUtf8 string + PieceLength int64 + Pieces []byte + Private *bool + Source string + func (info *Info) BuildFromFilePath(root string) (err error) + func (info *Info) GeneratePieces(open func(fi FileInfo) (io.ReadCloser, error)) (err error) + func (info *Info) IsDir() bool + func (info *Info) NumPieces() int + func (info *Info) Piece(index int) Piece + func (info *Info) TotalLength() (ret int64) + func (info *Info) UpvertedFiles() []FileInfo + func (info Info) BestName() string + type Magnet struct + DisplayName string + InfoHash Hash + Params url.Values + Trackers []string + func ParseMagnetUri(uri string) (m Magnet, err error) + func (m Magnet) String() string + type MetaInfo struct + Announce string + AnnounceList AnnounceList + Comment string + CreatedBy string + CreationDate int64 + Encoding string + InfoBytes bencode.Bytes + Nodes []Node + UrlList UrlList + func Load(r io.Reader) (*MetaInfo, error) + func LoadFromFile(filename string) (*MetaInfo, error) + func (mi *MetaInfo) Magnet(infoHash *Hash, info *Info) (m Magnet) + func (mi *MetaInfo) SetDefaults() + func (mi *MetaInfo) UpvertedAnnounceList() AnnounceList + func (mi MetaInfo) HashInfoBytes() (infoHash Hash) + func (mi MetaInfo) UnmarshalInfo() (info Info, err error) + func (mi MetaInfo) Write(w io.Writer) error + type Node string + func (n *Node) UnmarshalBencode(b []byte) (err error) + type Piece struct + Info *Info + func (p Piece) Hash() (ret Hash) + func (p Piece) Index() pieceIndex + func (p Piece) Length() int64 + func (p Piece) Offset() int64 + type PieceKey struct + Index pieceIndex + InfoHash Hash + type UrlList []string + func (me *UrlList) UnmarshalBencode(b []byte) error