diff options
| author | Felix Hanley <felix@userspace.com.au> | 2018-03-20 11:37:09 +0000 |
|---|---|---|
| committer | Felix Hanley <felix@userspace.com.au> | 2018-03-20 11:37:09 +0000 |
| commit | e2e746843dca7874d287420336b3ec4830203ff5 (patch) | |
| tree | c806afa152d33f1124ea03e943db60ead0497b9e /models | |
| parent | ef4aec50a8f6ace8076d4bfeef0ba64cf8598048 (diff) | |
| download | dhtsearch-e2e746843dca7874d287420336b3ec4830203ff5.tar.gz dhtsearch-e2e746843dca7874d287420336b3ec4830203ff5.tar.bz2 | |
Start working on SQL to relieve load
Diffstat (limited to 'models')
| -rw-r--r-- | models/peer.go | 4 | ||||
| -rw-r--r-- | models/storage.go | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/models/peer.go b/models/peer.go index 220d979..2810fd4 100644 --- a/models/peer.go +++ b/models/peer.go @@ -10,8 +10,8 @@ import ( type Peer struct { Addr net.Addr `db:"address"` Infohash Infohash `db:"infohash"` - Updated time.Time `json:"updated"` - Created time.Time `json:"created"` + Created time.Time `db:"created" json:"created"` + Updated time.Time `db:"updated" json:"updated"` } // String implements fmt.Stringer diff --git a/models/storage.go b/models/storage.go index c8a8344..92806ba 100644 --- a/models/storage.go +++ b/models/storage.go @@ -14,12 +14,11 @@ type torrentSearcher interface { type PeerStore interface { SavePeer(*Peer) error + RemovePeer(*Peer) error } type TorrentStore interface { SaveTorrent(*Torrent) error - // TODO - RemovePeer(*Peer) error } type InfohashStore interface { |
