Documentation
¶
Index ¶
- Constants
- type DB
- func (db *DB) Close() error
- func (db *DB) GetTorrent(ID string) (*Torrent, error)
- func (db *DB) GetTorrentByInfoHash(infoHash string) (*Torrent, error)
- func (db *DB) GetTorrentLog(infoHash, user string) (*TorrentLog, error)
- func (db *DB) GetUser(ID string) (*User, error)
- func (db *DB) Inner() *sql.DB
- func (db *DB) StoreTorrent(t *Torrent) (*Torrent, error)
- func (db *DB) StoreTorrentLog(l *TorrentLog) error
- func (db *DB) StoreUser(u *User) (*User, error)
- type Torrent
- type TorrentLog
- type User
Constants ¶
View Source
const TimeFormat = time.RFC3339
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
var Data *DB
func (*DB) GetTorrentByInfoHash ¶
func (*DB) GetTorrentLog ¶
func (db *DB) GetTorrentLog(infoHash, user string) (*TorrentLog, error)
func (*DB) StoreTorrentLog ¶
func (db *DB) StoreTorrentLog(l *TorrentLog) error
type Torrent ¶
type Torrent struct { ID string // Owner is the user that contributed the torrent Owner string // metadata Name string // TODO: how to implement this in the schema // Files []string Category string Freeleech bool // TODO: should figure out how to auto-calc this Leechers int64 Seeders int64 InfoHash string InfoBytes []byte }
Torrent is a torrent offered on the tracker
type TorrentLog ¶
Click to show internal directories.
Click to hide internal directories.