mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 05:43:41 +00:00
feat: new ui (#1455)
This commit is contained in:
742 files changed
+59951
-5934
No files matched your search
@@ -1,19 +1,35 @@
|
||||
package bt
|
||||
|
||||
import "github.com/GopeedLab/gopeed/pkg/base"
|
||||
|
||||
type ReqExtra struct {
|
||||
Trackers []string `json:"trackers"`
|
||||
}
|
||||
|
||||
// Stats for torrent
|
||||
type Stats struct {
|
||||
// health indicators of torrents, from large to small, ConnectedSeeders are also the key to the health of seed resources
|
||||
TotalPeers int `json:"totalPeers"`
|
||||
ActivePeers int `json:"activePeers"`
|
||||
ConnectedSeeders int `json:"connectedSeeders"`
|
||||
// StatsSnapshot contains cumulative BitTorrent data that remains meaningful
|
||||
// after the torrent is stopped or the application restarts.
|
||||
type StatsSnapshot struct {
|
||||
// Total seed bytes
|
||||
SeedBytes int64 `json:"seedBytes"`
|
||||
// Seed ratio
|
||||
SeedRatio float64 `json:"seedRatio"`
|
||||
// Total seed time
|
||||
SeedTime int64 `json:"seedTime"`
|
||||
// PieceMap contains verified local piece completion in compact bitset-v1
|
||||
// format. It is nil while metadata or storage completion is unavailable.
|
||||
PieceMap *base.PieceMap `json:"pieceMap"`
|
||||
}
|
||||
|
||||
// StatsRuntime contains live swarm telemetry. It is never persisted because
|
||||
// peer connections and live swarm counters cease to be valid once the fetcher
|
||||
// stops.
|
||||
type StatsRuntime struct {
|
||||
// Health indicators of torrents, from large to small. ConnectedSeeders are
|
||||
// also the key to the health of seed resources.
|
||||
TotalPeers int `json:"totalPeers"`
|
||||
ActivePeers int `json:"activePeers"`
|
||||
ConnectedSeeders int `json:"connectedSeeders"`
|
||||
ConnectedLeechers int `json:"connectedLeechers"`
|
||||
// Peers contains currently connected BitTorrent peers.
|
||||
Peers []*base.PeerStats `json:"peers"`
|
||||
}
|
||||
+18
-11
@@ -1,14 +1,21 @@
|
||||
package ed2k
|
||||
|
||||
type Stats struct {
|
||||
State string `json:"state"`
|
||||
Paused bool `json:"paused"`
|
||||
ActivePeers int `json:"activePeers"`
|
||||
TotalPeers int `json:"totalPeers"`
|
||||
DownloadRate int `json:"downloadRate"`
|
||||
Upload int64 `json:"upload"`
|
||||
UploadRate int `json:"uploadRate"`
|
||||
TotalDone int64 `json:"totalDone"`
|
||||
TotalReceived int64 `json:"totalReceived"`
|
||||
TotalWanted int64 `json:"totalWanted"`
|
||||
import "github.com/GopeedLab/gopeed/pkg/base"
|
||||
|
||||
type StatsSnapshot struct {
|
||||
Upload int64 `json:"upload"`
|
||||
TotalDone int64 `json:"totalDone"`
|
||||
TotalReceived int64 `json:"totalReceived"`
|
||||
TotalWanted int64 `json:"totalWanted"`
|
||||
PieceMap *base.PieceMap `json:"pieceMap"`
|
||||
}
|
||||
|
||||
type StatsRuntime struct {
|
||||
State string `json:"state"`
|
||||
Paused bool `json:"paused"`
|
||||
ActivePeers int `json:"activePeers"`
|
||||
TotalPeers int `json:"totalPeers"`
|
||||
DownloadRate int `json:"downloadRate"`
|
||||
UploadRate int `json:"uploadRate"`
|
||||
Peers []*base.PeerStats `json:"peers"`
|
||||
}
|
||||
@@ -30,6 +30,11 @@ type Stats struct {
|
||||
|
||||
type StatsConnection struct {
|
||||
Downloaded int64 `json:"downloaded"`
|
||||
// Total is the resource size divided by the current number of connections,
|
||||
// rounded up to a whole byte. Every connection in one snapshot uses the same
|
||||
// denominator so clients can compare their downloaded contributions. It is
|
||||
// zero when the resource size is unknown.
|
||||
Total int64 `json:"total"`
|
||||
Completed bool `json:"completed"`
|
||||
Failed bool `json:"failed"`
|
||||
RetryTimes int `json:"retryTimes"`
|
||||
|
||||
Reference in new issue
Block a user