2013-06-22 01:31:32 +02:00
|
|
|
// Copyright 2013 The Chihaya Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by the BSD 2-Clause license,
|
|
|
|
// which can be found in the LICENSE file.
|
|
|
|
|
2013-08-23 21:39:42 +02:00
|
|
|
package models
|
2013-06-22 01:31:32 +02:00
|
|
|
|
|
|
|
type Peer struct {
|
2013-07-24 06:18:43 +02:00
|
|
|
ID string `json:"id"`
|
|
|
|
UserID uint64 `json:"user_id"`
|
|
|
|
TorrentID uint64 `json:"torrent_id"`
|
|
|
|
IP string `json:"ip"`
|
|
|
|
Port uint64 `json:"port"`
|
|
|
|
Uploaded uint64 `json:"uploaded"`
|
|
|
|
Downloaded uint64 `json:"downloaded`
|
|
|
|
Left uint64 `json:"left"`
|
|
|
|
LastAnnounce int64 `json:"last_announce"`
|
2013-06-22 01:31:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type Torrent struct {
|
2013-07-24 06:18:43 +02:00
|
|
|
ID uint64 `json:"id"`
|
|
|
|
Infohash string `json:"infohash"`
|
2013-07-24 09:08:38 +02:00
|
|
|
Active bool `json:"active"`
|
2013-07-24 06:18:43 +02:00
|
|
|
Seeders map[string]Peer `json:"seeders"`
|
|
|
|
Leechers map[string]Peer `json:"leechers"`
|
|
|
|
Snatches uint `json:"snatches"`
|
|
|
|
UpMultiplier float64 `json:"up_multiplier"`
|
2013-09-01 21:59:46 +02:00
|
|
|
DownMultiplier float64 `json:"down_multiplier"`
|
2013-07-24 06:18:43 +02:00
|
|
|
LastAction int64 `json:"last_action"`
|
2013-06-22 01:31:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type User struct {
|
2013-07-24 06:18:43 +02:00
|
|
|
ID uint64 `json:"id"`
|
|
|
|
Passkey string `json:"passkey"`
|
|
|
|
UpMultiplier float64 `json:"up_multiplier"`
|
|
|
|
DownMultiplier float64 `json:"down_multiplier"`
|
|
|
|
Slots int64 `json:"slots"`
|
|
|
|
SlotsUsed int64 `json:"slots_used"`
|
2013-06-22 01:31:32 +02:00
|
|
|
}
|
2013-09-07 00:39:14 +02:00
|
|
|
|
|
|
|
type AnnounceDelta struct {
|
|
|
|
Peer *Peer
|
|
|
|
Torrent *Torrent
|
|
|
|
User *User
|
|
|
|
|
|
|
|
Uploaded uint64
|
|
|
|
Downloaded uint64
|
|
|
|
Timestamp float64
|
2013-09-07 01:01:02 +02:00
|
|
|
Snatched bool
|
2013-09-07 00:39:14 +02:00
|
|
|
}
|