Documentation ¶
Overview ¶
Package backend provides a generic interface for manipulating a BitTorrent tracker's consistent backend data store (usually for a web application).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn interface { // Close terminates connections to the database(s) and gracefully shuts // down the driver Close() error // Ping just checks to see if the database is still alive. This is typically // used for health checks. Ping() error // RecordAnnounce is called once per announce, and is passed the delta in // statistics for the client peer since its last announce. RecordAnnounce(delta *models.AnnounceDelta) error // LoadTorrents fetches and returns the specified torrents. LoadTorrents(ids []uint64) ([]*models.Torrent, error) // LoadUsers fetches and returns the specified users. LoadUsers(ids []uint64) ([]*models.User, error) // Get user given a user's passkey GetUserByPassKey(passkey string) (*models.User, error) // get a torrent given its infohash // doesn't load info or peer GetTorrentByInfoHash(infohash string) (*models.Torrent, error) // delete a torrent from the database DeleteTorrent(torrent *models.Torrent) error // add a torrent to the database AddTorrent(torrent *models.Torrent) error // add a user to the database AddUser(user *models.User) error // delete a user from the database DeleteUser(user *models.User) error }
Conn represents a connection to the data store.
Directories ¶
Path | Synopsis |
---|---|
Package noop implements a Chihaya backend storage driver as a no-op.
|
Package noop implements a Chihaya backend storage driver as a no-op. |
package uguu implements uguu-tracker storage driver using postgres
|
package uguu implements uguu-tracker storage driver using postgres |
Click to show internal directories.
Click to hide internal directories.