magnet

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Size = 20

Variables

View Source
var ParseMagnetURI = ParseMagnetUri

Deprecated: Use ParseMagnetUri.

Functions

This section is empty.

Types

type Magnet

type Magnet struct {
	InfoHash    T          // Expected in this implementation
	Trackers    []string   // "tr" values
	DisplayName string     // "dn" value, if not empty
	Params      url.Values // All other values, such as "x.pe", "as", "xs" etc.
}

Magnet link components.

func ParseMagnetUri

func ParseMagnetUri(uri string) (m Magnet, err error)

ParseMagnetUri parses Magnet-formatted URIs into a Magnet instance

type T

type T [Size]byte

20-byte SHA1 hash used for info and pieces.

func FromHexString

func FromHexString(s string) (h T)

func HashBytes

func HashBytes(b []byte) (ret T)

func (T) AsString

func (t T) AsString() string

func (T) Bytes

func (t T) Bytes() []byte

func (T) Format

func (t T) Format(f fmt.State, c rune)

func (*T) FromHexString

func (t *T) FromHexString(s string) (err error)

func (T) HexString

func (t T) HexString() string

func (T) MarshalText

func (t T) MarshalText() (text []byte, err error)

func (T) String

func (t T) String() string

func (*T) UnmarshalText

func (t *T) UnmarshalText(b []byte) error

Jump to

Keyboard shortcuts

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