-
Notifications
You must be signed in to change notification settings - Fork 70
/
rpctypes.go
275 lines (226 loc) · 3.96 KB
/
rpctypes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
package rpctypes
type Torrent struct {
ID string
Name string
InfoHash string
Port int
AddedAt Time
}
type Peer struct {
ID string
Client string
Addr string
Source string
ConnectedAt Time
Downloading bool
ClientInterested bool
ClientChoking bool
PeerInterested bool
PeerChoking bool
OptimisticUnchoked bool
Snubbed bool
EncryptedHandshake bool
EncryptedStream bool
DownloadSpeed int
UploadSpeed int
}
type Webseed struct {
URL string
Error *string
DownloadSpeed int
}
type Tracker struct {
URL string
Status string
Leechers int
Seeders int
Warning *string
Error *string
ErrorUnknown bool
ErrorInternal *string
LastAnnounce Time
NextAnnounce Time
}
type SessionStats struct {
Uptime int
Torrents int
Peers int
PortsAvailable int
BlockListRules int
BlockListRecency int
ReadCacheObjects int
ReadCacheSize int64
ReadCacheUtilization int
ReadsPerSecond int
ReadsActive int
ReadsPending int
WriteCacheObjects int
WriteCacheSize int64
WriteCachePendingKeys int
WritesPerSecond int
WritesActive int
WritesPending int
SpeedDownload int
SpeedUpload int
SpeedRead int
SpeedWrite int
}
type Stats struct {
Status string
Error *string
Pieces struct {
Checked uint32
Have uint32
Missing uint32
Available uint32
Total uint32
}
Bytes struct {
Total int64
Allocated int64
Completed int64
Incomplete int64
Downloaded int64
Uploaded int64
Wasted int64
}
Peers struct {
Total int
Incoming int
Outgoing int
}
Handshakes struct {
Total int
Incoming int
Outgoing int
}
Addresses struct {
Total int
Tracker int
DHT int
PEX int
}
Downloads struct {
Total int
Running int
Snubbed int
Choked int
}
MetadataDownloads struct {
Total int
Snubbed int
Running int
}
Name string
Private bool
PieceLength uint32
SeededFor uint
Speed struct {
Download int
Upload int
}
ETA *uint
}
type ListTorrentsRequest struct {
}
type ListTorrentsResponse struct {
Torrents []Torrent
}
type AddTorrentOptions struct {
Stopped bool
ID string
}
type AddTorrentRequest struct {
Torrent string
AddTorrentOptions
}
type AddTorrentResponse struct {
Torrent Torrent
}
type AddURIRequest struct {
URI string
AddTorrentOptions
}
type AddURIResponse struct {
Torrent Torrent
}
type RemoveTorrentRequest struct {
ID string
}
type RemoveTorrentResponse struct {
}
type GetSessionStatsRequest struct {
}
type GetSessionStatsResponse struct {
Stats SessionStats
}
type GetTorrentStatsRequest struct {
ID string
}
type GetTorrentStatsResponse struct {
Stats Stats
}
type GetTorrentTrackersRequest struct {
ID string
}
type GetTorrentTrackersResponse struct {
Trackers []Tracker
}
type GetTorrentPeersRequest struct {
ID string
}
type GetTorrentPeersResponse struct {
Peers []Peer
}
type GetTorrentWebseedsRequest struct {
ID string
}
type GetTorrentWebseedsResponse struct {
Webseeds []Webseed
}
type StartTorrentRequest struct {
ID string
}
type StartTorrentResponse struct {
}
type StopTorrentRequest struct {
ID string
}
type StopTorrentResponse struct {
}
type AnnounceTorrentRequest struct {
ID string
}
type AnnounceTorrentResponse struct {
}
type VerifyTorrentRequest struct {
ID string
}
type VerifyTorrentResponse struct {
}
type MoveTorrentRequest struct {
ID string
Target string
}
type MoveTorrentResponse struct {
}
type AddPeerRequest struct {
ID string
Addr string
}
type AddPeerResponse struct {
}
type AddTrackerRequest struct {
ID string
URL string
}
type AddTrackerResponse struct {
}
type StartAllTorrentsRequest struct {
}
type StartAllTorrentsResponse struct {
}
type StopAllTorrentsRequest struct {
}
type StopAllTorrentsResponse struct {
}