torrent

package
v0.0.0-...-c9505bf Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Search(keyword string, limit int) (*[]Torrent, error)

Search takes keyword to search torrents

Types

type Torrent

type Torrent struct {
	ID            int
	Title         string
	Magnet        string
	PubStamp      int64
	DownloadedAt  time.Time `sql:"-"`
	TorrentResult `sql:"-"`
}

Torrent (magnet links)

func SaveTorrentFromLink(link string) (*Torrent, error)

SaveTorrentFromLink creates a Torrent from a link

func (*Torrent) GetByPubStamp

func (t *Torrent) GetByPubStamp() (*Torrent, error)

GetByPubStamp find Torrent by PubStamp

func (*Torrent) HumanizeSize

func (t *Torrent) HumanizeSize() string

HumanizeSize returns Torrent.Size in human friendly unit

type TorrentResult

type TorrentResult struct {
	Title   string `json:"title"`
	Magnet  string `json:"magnet"`
	PubDate string `json:"pub_date"` // Ensure this field matches your API response

}

Jump to

Keyboard shortcuts

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