trackerlib

package
v0.0.0-...-949593f Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPeer

func AddPeer(peer data.Peer) error

func CheckTorrentAccessList

func CheckTorrentAccessList(torrentID int, userID int) (bool, error)

Check torrent access rights based on torrent_access_list table

func EncodePeerListAndRespond

func EncodePeerListAndRespond(w http.ResponseWriter, interval int, peerList []data.Peer) error

Takes peer list array and send bencoded response

func GetHTTPRequestIP

func GetHTTPRequestIP(r *http.Request) (string, error)

Get the IP address of the request

func GetTorrentIdByHash

func GetTorrentIdByHash(hash string) (int, error)

Gets the database ID for a torrent based on its info_hash

func LoadPeers

func LoadPeers(torrentID int, peer_id string) ([]data.Peer, error)

Return list of peers without including the requester as a peer

func RemovePeer

func RemovePeer(peer data.Peer) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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