Documentation
¶
Overview ¶
Package storage provides a generic interface for manipulating a BitTorrent tracker's web application data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnnounceDelta ¶
type AnnounceDelta struct { Peer *models.Peer Torrent *models.Torrent User *models.User // Created is true if this announce created a new peer or changed an existing peer's address Created bool // Uploaded contains the raw upload delta for this announce, in bytes Uploaded uint64 // Downloaded contains the raw download delta for this announce, in bytes Downloaded uint64 // Timestamp is the unix timestamp this announce occurred at Timestamp float64 // Snatched is true if this announce completed the download Snatched bool }
AnnounceDelta contains a difference in statistics for a peer. It is used for communicating changes to be recorded by the storage driver.
type Conn ¶
type Conn interface { // Start is called once when the server starts. // It starts any necessary goroutines a given driver requires, and sets // up the driver's initial state Start() error // Close terminates connections to the database(s) and gracefully shuts // down the driver Close() error // RecordAnnounce is called once per announce, and is passed the delta in // statistics for the client peer since its last announce. RecordAnnounce(delta *AnnounceDelta) error // LoadTorrents fetches and returns the specified torrents. LoadTorrents(ids []uint64) ([]*models.Torrent, error) // LoadAllTorrents fetches and returns all torrents. LoadAllTorrents() ([]*models.Torrent, error) // LoadUsers fetches and returns the specified users. LoadUsers(ids []uint64) ([]*models.User, error) // LoadAllUsers fetches and returns all users. LoadAllUsers(ids []uint64) ([]*models.User, error) }
Conn represents a connection to the data store.
Directories
¶
Path | Synopsis |
---|---|
Package batter provides a driver for a BitTorrent tracker to interface with the postgres database used by batter (github.com/wafflesfm/batter).
|
Package batter provides a driver for a BitTorrent tracker to interface with the postgres database used by batter (github.com/wafflesfm/batter). |
Package gazelle provides a driver for a BitTorrent tracker to interface with the MySQL database used by Gazelle (github.com/WhatCD/Gazelle).
|
Package gazelle provides a driver for a BitTorrent tracker to interface with the MySQL database used by Gazelle (github.com/WhatCD/Gazelle). |
Click to show internal directories.
Click to hide internal directories.