/
kbfs_common.go
339 lines (300 loc) · 9.29 KB
/
kbfs_common.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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
// Auto-generated by avdl-compiler v1.3.25 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/keybase1/kbfs_common.avdl
package keybase1
import (
"github.com/keybase/go-framed-msgpack-rpc/rpc"
)
type FSStatusCode int
const (
FSStatusCode_START FSStatusCode = 0
FSStatusCode_FINISH FSStatusCode = 1
FSStatusCode_ERROR FSStatusCode = 2
)
func (o FSStatusCode) DeepCopy() FSStatusCode { return o }
var FSStatusCodeMap = map[string]FSStatusCode{
"START": 0,
"FINISH": 1,
"ERROR": 2,
}
var FSStatusCodeRevMap = map[FSStatusCode]string{
0: "START",
1: "FINISH",
2: "ERROR",
}
func (e FSStatusCode) String() string {
if v, ok := FSStatusCodeRevMap[e]; ok {
return v
}
return ""
}
type FSNotificationType int
const (
FSNotificationType_ENCRYPTING FSNotificationType = 0
FSNotificationType_DECRYPTING FSNotificationType = 1
FSNotificationType_SIGNING FSNotificationType = 2
FSNotificationType_VERIFYING FSNotificationType = 3
FSNotificationType_REKEYING FSNotificationType = 4
FSNotificationType_CONNECTION FSNotificationType = 5
FSNotificationType_MD_READ_SUCCESS FSNotificationType = 6
FSNotificationType_FILE_CREATED FSNotificationType = 7
FSNotificationType_FILE_MODIFIED FSNotificationType = 8
FSNotificationType_FILE_DELETED FSNotificationType = 9
FSNotificationType_FILE_RENAMED FSNotificationType = 10
FSNotificationType_INITIALIZED FSNotificationType = 11
)
func (o FSNotificationType) DeepCopy() FSNotificationType { return o }
var FSNotificationTypeMap = map[string]FSNotificationType{
"ENCRYPTING": 0,
"DECRYPTING": 1,
"SIGNING": 2,
"VERIFYING": 3,
"REKEYING": 4,
"CONNECTION": 5,
"MD_READ_SUCCESS": 6,
"FILE_CREATED": 7,
"FILE_MODIFIED": 8,
"FILE_DELETED": 9,
"FILE_RENAMED": 10,
"INITIALIZED": 11,
}
var FSNotificationTypeRevMap = map[FSNotificationType]string{
0: "ENCRYPTING",
1: "DECRYPTING",
2: "SIGNING",
3: "VERIFYING",
4: "REKEYING",
5: "CONNECTION",
6: "MD_READ_SUCCESS",
7: "FILE_CREATED",
8: "FILE_MODIFIED",
9: "FILE_DELETED",
10: "FILE_RENAMED",
11: "INITIALIZED",
}
func (e FSNotificationType) String() string {
if v, ok := FSNotificationTypeRevMap[e]; ok {
return v
}
return ""
}
type FSErrorType int
const (
FSErrorType_ACCESS_DENIED FSErrorType = 0
FSErrorType_USER_NOT_FOUND FSErrorType = 1
FSErrorType_REVOKED_DATA_DETECTED FSErrorType = 2
FSErrorType_NOT_LOGGED_IN FSErrorType = 3
FSErrorType_TIMEOUT FSErrorType = 4
FSErrorType_REKEY_NEEDED FSErrorType = 5
FSErrorType_BAD_FOLDER FSErrorType = 6
FSErrorType_NOT_IMPLEMENTED FSErrorType = 7
FSErrorType_OLD_VERSION FSErrorType = 8
FSErrorType_OVER_QUOTA FSErrorType = 9
FSErrorType_NO_SIG_CHAIN FSErrorType = 10
FSErrorType_TOO_MANY_FOLDERS FSErrorType = 11
FSErrorType_EXDEV_NOT_SUPPORTED FSErrorType = 12
FSErrorType_DISK_LIMIT_REACHED FSErrorType = 13
FSErrorType_DISK_CACHE_ERROR_LOG_SEND FSErrorType = 14
)
func (o FSErrorType) DeepCopy() FSErrorType { return o }
var FSErrorTypeMap = map[string]FSErrorType{
"ACCESS_DENIED": 0,
"USER_NOT_FOUND": 1,
"REVOKED_DATA_DETECTED": 2,
"NOT_LOGGED_IN": 3,
"TIMEOUT": 4,
"REKEY_NEEDED": 5,
"BAD_FOLDER": 6,
"NOT_IMPLEMENTED": 7,
"OLD_VERSION": 8,
"OVER_QUOTA": 9,
"NO_SIG_CHAIN": 10,
"TOO_MANY_FOLDERS": 11,
"EXDEV_NOT_SUPPORTED": 12,
"DISK_LIMIT_REACHED": 13,
"DISK_CACHE_ERROR_LOG_SEND": 14,
}
var FSErrorTypeRevMap = map[FSErrorType]string{
0: "ACCESS_DENIED",
1: "USER_NOT_FOUND",
2: "REVOKED_DATA_DETECTED",
3: "NOT_LOGGED_IN",
4: "TIMEOUT",
5: "REKEY_NEEDED",
6: "BAD_FOLDER",
7: "NOT_IMPLEMENTED",
8: "OLD_VERSION",
9: "OVER_QUOTA",
10: "NO_SIG_CHAIN",
11: "TOO_MANY_FOLDERS",
12: "EXDEV_NOT_SUPPORTED",
13: "DISK_LIMIT_REACHED",
14: "DISK_CACHE_ERROR_LOG_SEND",
}
func (e FSErrorType) String() string {
if v, ok := FSErrorTypeRevMap[e]; ok {
return v
}
return ""
}
type FSNotification struct {
Filename string `codec:"filename" json:"filename"`
Status string `codec:"status" json:"status"`
StatusCode FSStatusCode `codec:"statusCode" json:"statusCode"`
NotificationType FSNotificationType `codec:"notificationType" json:"notificationType"`
ErrorType FSErrorType `codec:"errorType" json:"errorType"`
Params map[string]string `codec:"params" json:"params"`
WriterUid UID `codec:"writerUid" json:"writerUid"`
LocalTime Time `codec:"localTime" json:"localTime"`
FolderType FolderType `codec:"folderType" json:"folderType"`
}
func (o FSNotification) DeepCopy() FSNotification {
return FSNotification{
Filename: o.Filename,
Status: o.Status,
StatusCode: o.StatusCode.DeepCopy(),
NotificationType: o.NotificationType.DeepCopy(),
ErrorType: o.ErrorType.DeepCopy(),
Params: (func(x map[string]string) map[string]string {
if x == nil {
return nil
}
ret := make(map[string]string, len(x))
for k, v := range x {
kCopy := k
vCopy := v
ret[kCopy] = vCopy
}
return ret
})(o.Params),
WriterUid: o.WriterUid.DeepCopy(),
LocalTime: o.LocalTime.DeepCopy(),
FolderType: o.FolderType.DeepCopy(),
}
}
type FSEditListRequest struct {
Folder Folder `codec:"folder" json:"folder"`
RequestID int `codec:"requestID" json:"requestID"`
}
func (o FSEditListRequest) DeepCopy() FSEditListRequest {
return FSEditListRequest{
Folder: o.Folder.DeepCopy(),
RequestID: o.RequestID,
}
}
type FSFolderWriterEdit struct {
Filename string `codec:"filename" json:"filename"`
NotificationType FSNotificationType `codec:"notificationType" json:"notificationType"`
ServerTime Time `codec:"serverTime" json:"serverTime"`
}
func (o FSFolderWriterEdit) DeepCopy() FSFolderWriterEdit {
return FSFolderWriterEdit{
Filename: o.Filename,
NotificationType: o.NotificationType.DeepCopy(),
ServerTime: o.ServerTime.DeepCopy(),
}
}
type FSFolderWriterEditHistory struct {
WriterName string `codec:"writerName" json:"writerName"`
Edits []FSFolderWriterEdit `codec:"edits" json:"edits"`
}
func (o FSFolderWriterEditHistory) DeepCopy() FSFolderWriterEditHistory {
return FSFolderWriterEditHistory{
WriterName: o.WriterName,
Edits: (func(x []FSFolderWriterEdit) []FSFolderWriterEdit {
if x == nil {
return nil
}
ret := make([]FSFolderWriterEdit, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Edits),
}
}
type FSFolderEditHistory struct {
Folder Folder `codec:"folder" json:"folder"`
ServerTime Time `codec:"serverTime" json:"serverTime"`
History []FSFolderWriterEditHistory `codec:"history" json:"history"`
}
func (o FSFolderEditHistory) DeepCopy() FSFolderEditHistory {
return FSFolderEditHistory{
Folder: o.Folder.DeepCopy(),
ServerTime: o.ServerTime.DeepCopy(),
History: (func(x []FSFolderWriterEditHistory) []FSFolderWriterEditHistory {
if x == nil {
return nil
}
ret := make([]FSFolderWriterEditHistory, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.History),
}
}
type FSSyncStatusRequest struct {
RequestID int `codec:"requestID" json:"requestID"`
}
func (o FSSyncStatusRequest) DeepCopy() FSSyncStatusRequest {
return FSSyncStatusRequest{
RequestID: o.RequestID,
}
}
type FSPathSyncStatus struct {
FolderType FolderType `codec:"folderType" json:"folderType"`
Path string `codec:"path" json:"path"`
SyncingBytes int64 `codec:"syncingBytes" json:"syncingBytes"`
SyncingOps int64 `codec:"syncingOps" json:"syncingOps"`
SyncedBytes int64 `codec:"syncedBytes" json:"syncedBytes"`
}
func (o FSPathSyncStatus) DeepCopy() FSPathSyncStatus {
return FSPathSyncStatus{
FolderType: o.FolderType.DeepCopy(),
Path: o.Path,
SyncingBytes: o.SyncingBytes,
SyncingOps: o.SyncingOps,
SyncedBytes: o.SyncedBytes,
}
}
type FSSyncStatus struct {
TotalSyncingBytes int64 `codec:"totalSyncingBytes" json:"totalSyncingBytes"`
SyncingPaths []string `codec:"syncingPaths" json:"syncingPaths"`
EndEstimate *Time `codec:"endEstimate,omitempty" json:"endEstimate,omitempty"`
}
func (o FSSyncStatus) DeepCopy() FSSyncStatus {
return FSSyncStatus{
TotalSyncingBytes: o.TotalSyncingBytes,
SyncingPaths: (func(x []string) []string {
if x == nil {
return nil
}
ret := make([]string, len(x))
for i, v := range x {
vCopy := v
ret[i] = vCopy
}
return ret
})(o.SyncingPaths),
EndEstimate: (func(x *Time) *Time {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.EndEstimate),
}
}
type KbfsCommonInterface interface {
}
func KbfsCommonProtocol(i KbfsCommonInterface) rpc.Protocol {
return rpc.Protocol{
Name: "keybase.1.kbfsCommon",
Methods: map[string]rpc.ServeHandlerDescription{},
}
}
type KbfsCommonClient struct {
Cli rpc.GenericClient
}