Simpler interface

This commit is contained in:
Justin Li
2014-07-16 13:03:59 -04:00
parent 3ceaf72034
commit 2a4d4c5aef
5 changed files with 13 additions and 39 deletions

View File

@@ -69,6 +69,7 @@ type Pool interface {
// Conn represents a connection to the data store that can be used
// to make reads/writes.
type Conn interface {
// Torrent interactions
FindTorrent(infohash string) (*models.Torrent, error)
PutTorrent(t *models.Torrent) error
DeleteTorrent(infohash string) error
@@ -78,14 +79,13 @@ type Conn interface {
DeleteLeecher(infohash, peerkey string) error
PutSeeder(infohash string, p *models.Peer) error
DeleteSeeder(infohash, peerkey string) error
}
// PrivateConn represents a connection that can service queries for private trackers.
type PrivateConn interface {
// User interactions
FindUser(passkey string) (*models.User, error)
PutUser(u *models.User) error
DeleteUser(passkey string) error
// Whitelist interactions
FindClient(clientID string) error
PutClient(clientID string) error
DeleteClient(clientID string) error