aboutsummaryrefslogtreecommitdiff
path: root/models/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/storage.go')
-rw-r--r--models/storage.go26
1 files changed, 19 insertions, 7 deletions
diff --git a/models/storage.go b/models/storage.go
index 84ac6aa..c8a8344 100644
--- a/models/storage.go
+++ b/models/storage.go
@@ -1,15 +1,27 @@
package models
+import ()
+
+type migratable interface {
+ MigrateSchema() error
+}
+
type torrentSearcher interface {
- torrentsByHash(hashes Infohash, offset, limit int) (*Torrent, error)
- torrentsByName(query string, offset, limit int) ([]*Torrent, error)
- torrentsByTags(tags []string, offset, limit int) ([]*Torrent, error)
+ TorrentsByHash(hash Infohash) (*Torrent, error)
+ TorrentsByName(query string, offset, limit int) ([]*Torrent, error)
+ TorrentsByTags(tags []string, offset, limit int) ([]*Torrent, error)
+}
+
+type PeerStore interface {
+ SavePeer(*Peer) error
}
-type peerStore interface {
- savePeer(*Peer) error
+type TorrentStore interface {
+ SaveTorrent(*Torrent) error
+ // TODO
+ RemovePeer(*Peer) error
}
-type torrentStore interface {
- saveTorrent(*Torrent) error
+type InfohashStore interface {
+ PendingInfohashes(int) ([]*Peer, error)
}