mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-11 19:18:12 -07:00
Completed cache.Tx tests and added benchmarks
This commit is contained in:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user