Documentation ¶
Index ¶
Constants ¶
View Source
const ( HashSHA1 = "sha1" HashSHA256 = "sha256" )
Hash type
Variables ¶
View Source
var ( ErrMalformedMagnetLink = errors.New("Malformed magnet link") ErrWrongMagnetLinkType = errors.New("Wrong magnet link type") )
Errors
View Source
var (
ErrMalformedUrn = errors.New("Malformed urn")
)
Errors
Functions ¶
This section is empty.
Types ¶
type MagnetLink ¶
type MagnetLink struct { Dn []string // Display name Xt []Urn // Exact topic Xl []int // Exact length As []string // Acceptable source Xs []string // Exact source Kt []string // Keyword topic Mt []string // Manifest topic Tr []string // Tracker address So []NumRange // Select only Exps map[string][]string // Experimental parameters (which must begin with "x.") Unknowns map[string][]string // Uknown parameters }
MagnetLink defines magnet link
func ParseMagnetLink ¶
func ParseMagnetLink(uri string, opts ...MagnetLinkParseOption) (*MagnetLink, error)
ParseMagnetLink parses magnetLink uri
func (*MagnetLink) AsTorrent ¶
func (l *MagnetLink) AsTorrent() (*TorrentMagnetLink, error)
AsTorrent converts to TorrentMagnetLink
type MagnetLinkParseOption ¶
type MagnetLinkParseOption interface {
// contains filtered or unexported methods
}
MagnetLinkParseOption defines the magnet link parse option
func WithMagnetLinkParseStrictOption ¶
func WithMagnetLinkParseStrictOption(strict bool) MagnetLinkParseOption
WithMagnetLinkParseStrictOption defines the strict option
type NumRange ¶
NumRange defines a number range
func NewSingleNumRange ¶
NewSingleNumRange creates a new NumRange by a single number
func ParseNumRangeFromString ¶
ParseNumRangeFromString parses a number range from string Format:
\d+ \d+\-\d+
type TorrentMagnetLink ¶
type TorrentMagnetLink struct { *MagnetLink InfoHashs []HashValue }
TorrentMagnetLink defines torrent magnet link
func ParseTorrentMagnetLink ¶
func ParseTorrentMagnetLink(uri string, opts ...MagnetLinkParseOption) (*TorrentMagnetLink, error)
ParseTorrentMagnetLink parses torrent magnet link
Source Files ¶
Click to show internal directories.
Click to hide internal directories.