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.
|
|
|
|
|
|
|
|
package storage
|
|
|
|
|
|
|
|
type Peer struct {
|
2013-06-28 22:29:02 +02:00
|
|
|
ID string
|
|
|
|
UserID uint64
|
|
|
|
TorrentID uint64
|
2013-06-22 01:31:32 +02:00
|
|
|
|
|
|
|
Port uint
|
2013-06-28 22:29:02 +02:00
|
|
|
IP string
|
2013-06-22 01:31:32 +02:00
|
|
|
Addr []byte
|
|
|
|
|
|
|
|
Uploaded uint64
|
|
|
|
Downloaded uint64
|
|
|
|
Left uint64
|
|
|
|
Seeding bool
|
|
|
|
|
2013-06-28 22:29:02 +02:00
|
|
|
StartTimeUnix int64
|
|
|
|
LastAnnounce int64
|
2013-06-22 01:31:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type Torrent struct {
|
2013-06-28 22:29:02 +02:00
|
|
|
ID uint64
|
|
|
|
Infohash string
|
2013-06-22 01:31:32 +02:00
|
|
|
UpMultiplier float64
|
|
|
|
DownMultiplier float64
|
|
|
|
|
|
|
|
Seeders map[string]*Peer
|
|
|
|
Leechers map[string]*Peer
|
|
|
|
|
|
|
|
Snatched uint
|
|
|
|
Status int64
|
|
|
|
LastAction int64
|
|
|
|
}
|
|
|
|
|
|
|
|
type User struct {
|
2013-06-28 22:29:02 +02:00
|
|
|
ID uint64
|
2013-06-22 01:31:32 +02:00
|
|
|
Passkey string
|
|
|
|
UpMultiplier float64
|
|
|
|
DownMultiplier float64
|
|
|
|
Slots int64
|
|
|
|
UsedSlots int64
|
|
|
|
|
|
|
|
SlotsLastChecked int64
|
|
|
|
}
|