Completed cache.Tx tests and added benchmarks

This commit is contained in:
cpb8010
2013-09-16 00:06:48 -04:00
parent 3caa06b5f6
commit 1ea24f80dc
6 changed files with 527 additions and 323 deletions
+8
View File
@@ -4,6 +4,10 @@
package models
import (
"strconv"
)
type Peer struct {
ID string `json:"id"`
UserID uint64 `json:"user_id"`
@@ -18,6 +22,10 @@ type Peer struct {
LastAnnounce int64 `json:"last_announce"`
}
func PeerMapKey(peer *Peer) string {
return peer.ID + ":" + strconv.FormatUint(peer.UserID, 36)
}
type Torrent struct {
ID uint64 `json:"id"`
Infohash string `json:"infohash"`