diff options
| author | Felix Hanley <felix@userspace.com.au> | 2018-03-13 11:29:49 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2018-03-13 11:29:49 +0000 |
| commit | 79c6a22d81e6ceadb23636e90e5d53f2a86e090d (patch) | |
| tree | 33776c9bedc99ccd87c1c7061b6195500c05f54d /models/storage.go | |
| parent | a67075e332458002ce4c56c0aa07e03807dc22ea (diff) | |
| download | dhtsearch-79c6a22d81e6ceadb23636e90e5d53f2a86e090d.tar.gz dhtsearch-79c6a22d81e6ceadb23636e90e5d53f2a86e090d.tar.bz2 | |
Fix tagging and announce callbacks
Diffstat (limited to 'models/storage.go')
| -rw-r--r-- | models/storage.go | 26 |
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) } |
