-
Notifications
You must be signed in to change notification settings - Fork 38
/
common.go
1195 lines (1004 loc) · 25.9 KB
/
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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Auto-generated to Go types using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler)
// Input file: ../client/protocol/avdl/keybase1/common.avdl
package keybase1
import (
"errors"
"fmt"
)
type Time int64
func (o Time) DeepCopy() Time {
return o
}
type UnixTime int64
func (o UnixTime) DeepCopy() UnixTime {
return o
}
type DurationSec float64
func (o DurationSec) DeepCopy() DurationSec {
return o
}
type DurationMsec float64
func (o DurationMsec) DeepCopy() DurationMsec {
return o
}
type StringKVPair struct {
Key string `codec:"key" json:"key"`
Value string `codec:"value" json:"value"`
}
func (o StringKVPair) DeepCopy() StringKVPair {
return StringKVPair{
Key: o.Key,
Value: o.Value,
}
}
type Status struct {
Code int `codec:"code" json:"code"`
Name string `codec:"name" json:"name"`
Desc string `codec:"desc" json:"desc"`
Fields []StringKVPair `codec:"fields" json:"fields"`
}
func (o Status) DeepCopy() Status {
return Status{
Code: o.Code,
Name: o.Name,
Desc: o.Desc,
Fields: (func(x []StringKVPair) []StringKVPair {
if x == nil {
return nil
}
ret := make([]StringKVPair, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Fields),
}
}
type UID string
func (o UID) DeepCopy() UID {
return o
}
type VID string
func (o VID) DeepCopy() VID {
return o
}
type DeviceID string
func (o DeviceID) DeepCopy() DeviceID {
return o
}
type SigID string
func (o SigID) DeepCopy() SigID {
return o
}
type LeaseID string
func (o LeaseID) DeepCopy() LeaseID {
return o
}
type KID string
func (o KID) DeepCopy() KID {
return o
}
type PhoneNumber string
func (o PhoneNumber) DeepCopy() PhoneNumber {
return o
}
type RawPhoneNumber string
func (o RawPhoneNumber) DeepCopy() RawPhoneNumber {
return o
}
type LinkID string
func (o LinkID) DeepCopy() LinkID {
return o
}
type BinaryLinkID []byte
func (o BinaryLinkID) DeepCopy() BinaryLinkID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type BinaryKID []byte
func (o BinaryKID) DeepCopy() BinaryKID {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type TLFID string
func (o TLFID) DeepCopy() TLFID {
return o
}
type TeamID string
func (o TeamID) DeepCopy() TeamID {
return o
}
type UserOrTeamID string
func (o UserOrTeamID) DeepCopy() UserOrTeamID {
return o
}
type GitRepoName string
func (o GitRepoName) DeepCopy() GitRepoName {
return o
}
type HashMeta []byte
func (o HashMeta) DeepCopy() HashMeta {
return (func(x []byte) []byte {
if x == nil {
return nil
}
return append([]byte{}, x...)
})(o)
}
type UserVersion struct {
Uid UID `codec:"uid" json:"uid"`
EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"`
}
func (o UserVersion) DeepCopy() UserVersion {
return UserVersion{
Uid: o.Uid.DeepCopy(),
EldestSeqno: o.EldestSeqno.DeepCopy(),
}
}
type TeamType int
const (
TeamType_NONE TeamType = 0
TeamType_LEGACY TeamType = 1
TeamType_MODERN TeamType = 2
)
func (o TeamType) DeepCopy() TeamType { return o }
var TeamTypeMap = map[string]TeamType{
"NONE": 0,
"LEGACY": 1,
"MODERN": 2,
}
var TeamTypeRevMap = map[TeamType]string{
0: "NONE",
1: "LEGACY",
2: "MODERN",
}
func (e TeamType) String() string {
if v, ok := TeamTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type CompatibilityTeamID struct {
Typ__ TeamType `codec:"typ" json:"typ"`
Legacy__ *TLFID `codec:"legacy,omitempty" json:"legacy,omitempty"`
Modern__ *TeamID `codec:"modern,omitempty" json:"modern,omitempty"`
}
func (o *CompatibilityTeamID) Typ() (ret TeamType, err error) {
switch o.Typ__ {
case TeamType_LEGACY:
if o.Legacy__ == nil {
err = errors.New("unexpected nil value for Legacy__")
return ret, err
}
case TeamType_MODERN:
if o.Modern__ == nil {
err = errors.New("unexpected nil value for Modern__")
return ret, err
}
}
return o.Typ__, nil
}
func (o CompatibilityTeamID) Legacy() (res TLFID) {
if o.Typ__ != TeamType_LEGACY {
panic("wrong case accessed")
}
if o.Legacy__ == nil {
return
}
return *o.Legacy__
}
func (o CompatibilityTeamID) Modern() (res TeamID) {
if o.Typ__ != TeamType_MODERN {
panic("wrong case accessed")
}
if o.Modern__ == nil {
return
}
return *o.Modern__
}
func NewCompatibilityTeamIDWithLegacy(v TLFID) CompatibilityTeamID {
return CompatibilityTeamID{
Typ__: TeamType_LEGACY,
Legacy__: &v,
}
}
func NewCompatibilityTeamIDWithModern(v TeamID) CompatibilityTeamID {
return CompatibilityTeamID{
Typ__: TeamType_MODERN,
Modern__: &v,
}
}
func (o CompatibilityTeamID) DeepCopy() CompatibilityTeamID {
return CompatibilityTeamID{
Typ__: o.Typ__.DeepCopy(),
Legacy__: (func(x *TLFID) *TLFID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Legacy__),
Modern__: (func(x *TeamID) *TeamID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Modern__),
}
}
type TLFVisibility int
const (
TLFVisibility_ANY TLFVisibility = 0
TLFVisibility_PUBLIC TLFVisibility = 1
TLFVisibility_PRIVATE TLFVisibility = 2
)
func (o TLFVisibility) DeepCopy() TLFVisibility { return o }
var TLFVisibilityMap = map[string]TLFVisibility{
"ANY": 0,
"PUBLIC": 1,
"PRIVATE": 2,
}
var TLFVisibilityRevMap = map[TLFVisibility]string{
0: "ANY",
1: "PUBLIC",
2: "PRIVATE",
}
func (e TLFVisibility) String() string {
if v, ok := TLFVisibilityRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type TeamIDWithVisibility struct {
TeamID TeamID `codec:"teamID" json:"teamID"`
Visibility TLFVisibility `codec:"visibility" json:"visibility"`
}
func (o TeamIDWithVisibility) DeepCopy() TeamIDWithVisibility {
return TeamIDWithVisibility{
TeamID: o.TeamID.DeepCopy(),
Visibility: o.Visibility.DeepCopy(),
}
}
type TeamIDAndName struct {
Id TeamID `codec:"id" json:"id"`
Name TeamName `codec:"name" json:"name"`
}
func (o TeamIDAndName) DeepCopy() TeamIDAndName {
return TeamIDAndName{
Id: o.Id.DeepCopy(),
Name: o.Name.DeepCopy(),
}
}
type Seqno int64
func (o Seqno) DeepCopy() Seqno {
return o
}
type SeqType int
const (
SeqType_NONE SeqType = 0
SeqType_PUBLIC SeqType = 1
SeqType_PRIVATE SeqType = 2
SeqType_SEMIPRIVATE SeqType = 3
SeqType_USER_PRIVATE_HIDDEN SeqType = 16
SeqType_TEAM_PRIVATE_HIDDEN SeqType = 17
)
func (o SeqType) DeepCopy() SeqType { return o }
var SeqTypeMap = map[string]SeqType{
"NONE": 0,
"PUBLIC": 1,
"PRIVATE": 2,
"SEMIPRIVATE": 3,
"USER_PRIVATE_HIDDEN": 16,
"TEAM_PRIVATE_HIDDEN": 17,
}
var SeqTypeRevMap = map[SeqType]string{
0: "NONE",
1: "PUBLIC",
2: "PRIVATE",
3: "SEMIPRIVATE",
16: "USER_PRIVATE_HIDDEN",
17: "TEAM_PRIVATE_HIDDEN",
}
func (e SeqType) String() string {
if v, ok := SeqTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type Bytes32 [32]byte
func (o Bytes32) DeepCopy() Bytes32 {
var ret Bytes32
copy(ret[:], o[:])
return ret
}
type Text struct {
Data string `codec:"data" json:"data"`
Markup bool `codec:"markup" json:"markup"`
}
func (o Text) DeepCopy() Text {
return Text{
Data: o.Data,
Markup: o.Markup,
}
}
type PGPIdentity struct {
Username string `codec:"username" json:"username"`
Comment string `codec:"comment" json:"comment"`
Email string `codec:"email" json:"email"`
}
func (o PGPIdentity) DeepCopy() PGPIdentity {
return PGPIdentity{
Username: o.Username,
Comment: o.Comment,
Email: o.Email,
}
}
type PublicKey struct {
KID KID `codec:"KID" json:"KID"`
PGPFingerprint string `codec:"PGPFingerprint" json:"PGPFingerprint"`
PGPIdentities []PGPIdentity `codec:"PGPIdentities" json:"PGPIdentities"`
IsSibkey bool `codec:"isSibkey" json:"isSibkey"`
IsEldest bool `codec:"isEldest" json:"isEldest"`
ParentID string `codec:"parentID" json:"parentID"`
DeviceID DeviceID `codec:"deviceID" json:"deviceID"`
DeviceDescription string `codec:"deviceDescription" json:"deviceDescription"`
DeviceType DeviceTypeV2 `codec:"deviceType" json:"deviceType"`
CTime Time `codec:"cTime" json:"cTime"`
ETime Time `codec:"eTime" json:"eTime"`
IsRevoked bool `codec:"isRevoked" json:"isRevoked"`
}
func (o PublicKey) DeepCopy() PublicKey {
return PublicKey{
KID: o.KID.DeepCopy(),
PGPFingerprint: o.PGPFingerprint,
PGPIdentities: (func(x []PGPIdentity) []PGPIdentity {
if x == nil {
return nil
}
ret := make([]PGPIdentity, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.PGPIdentities),
IsSibkey: o.IsSibkey,
IsEldest: o.IsEldest,
ParentID: o.ParentID,
DeviceID: o.DeviceID.DeepCopy(),
DeviceDescription: o.DeviceDescription,
DeviceType: o.DeviceType.DeepCopy(),
CTime: o.CTime.DeepCopy(),
ETime: o.ETime.DeepCopy(),
IsRevoked: o.IsRevoked,
}
}
type KeybaseTime struct {
Unix Time `codec:"unix" json:"unix"`
Chain Seqno `codec:"chain" json:"chain"`
}
func (o KeybaseTime) DeepCopy() KeybaseTime {
return KeybaseTime{
Unix: o.Unix.DeepCopy(),
Chain: o.Chain.DeepCopy(),
}
}
type RevokedKey struct {
Key PublicKey `codec:"key" json:"key"`
Time KeybaseTime `codec:"time" json:"time"`
By KID `codec:"by" json:"by"`
}
func (o RevokedKey) DeepCopy() RevokedKey {
return RevokedKey{
Key: o.Key.DeepCopy(),
Time: o.Time.DeepCopy(),
By: o.By.DeepCopy(),
}
}
type User struct {
Uid UID `codec:"uid" json:"uid"`
Username string `codec:"username" json:"username"`
}
func (o User) DeepCopy() User {
return User{
Uid: o.Uid.DeepCopy(),
Username: o.Username,
}
}
type Device struct {
Type DeviceTypeV2 `codec:"type" json:"type"`
Name string `codec:"name" json:"name"`
DeviceID DeviceID `codec:"deviceID" json:"deviceID"`
DeviceNumberOfType int `codec:"deviceNumberOfType" json:"deviceNumberOfType"`
CTime Time `codec:"cTime" json:"cTime"`
MTime Time `codec:"mTime" json:"mTime"`
LastUsedTime Time `codec:"lastUsedTime" json:"lastUsedTime"`
EncryptKey KID `codec:"encryptKey" json:"encryptKey"`
VerifyKey KID `codec:"verifyKey" json:"verifyKey"`
Status int `codec:"status" json:"status"`
}
func (o Device) DeepCopy() Device {
return Device{
Type: o.Type.DeepCopy(),
Name: o.Name,
DeviceID: o.DeviceID.DeepCopy(),
DeviceNumberOfType: o.DeviceNumberOfType,
CTime: o.CTime.DeepCopy(),
MTime: o.MTime.DeepCopy(),
LastUsedTime: o.LastUsedTime.DeepCopy(),
EncryptKey: o.EncryptKey.DeepCopy(),
VerifyKey: o.VerifyKey.DeepCopy(),
Status: o.Status,
}
}
type DeviceType int
const (
DeviceType_DESKTOP DeviceType = 0
DeviceType_MOBILE DeviceType = 1
)
func (o DeviceType) DeepCopy() DeviceType { return o }
var DeviceTypeMap = map[string]DeviceType{
"DESKTOP": 0,
"MOBILE": 1,
}
var DeviceTypeRevMap = map[DeviceType]string{
0: "DESKTOP",
1: "MOBILE",
}
func (e DeviceType) String() string {
if v, ok := DeviceTypeRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type DeviceTypeV2 string
func (o DeviceTypeV2) DeepCopy() DeviceTypeV2 {
return o
}
type Stream struct {
Fd int `codec:"fd" json:"fd"`
}
func (o Stream) DeepCopy() Stream {
return Stream{
Fd: o.Fd,
}
}
type LogLevel int
const (
LogLevel_NONE LogLevel = 0
LogLevel_DEBUG LogLevel = 1
LogLevel_INFO LogLevel = 2
LogLevel_NOTICE LogLevel = 3
LogLevel_WARN LogLevel = 4
LogLevel_ERROR LogLevel = 5
LogLevel_CRITICAL LogLevel = 6
LogLevel_FATAL LogLevel = 7
)
func (o LogLevel) DeepCopy() LogLevel { return o }
var LogLevelMap = map[string]LogLevel{
"NONE": 0,
"DEBUG": 1,
"INFO": 2,
"NOTICE": 3,
"WARN": 4,
"ERROR": 5,
"CRITICAL": 6,
"FATAL": 7,
}
var LogLevelRevMap = map[LogLevel]string{
0: "NONE",
1: "DEBUG",
2: "INFO",
3: "NOTICE",
4: "WARN",
5: "ERROR",
6: "CRITICAL",
7: "FATAL",
}
func (e LogLevel) String() string {
if v, ok := LogLevelRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type ClientType int
const (
ClientType_NONE ClientType = 0
ClientType_CLI ClientType = 1
ClientType_GUI_MAIN ClientType = 2
ClientType_KBFS ClientType = 3
ClientType_GUI_HELPER ClientType = 4
)
func (o ClientType) DeepCopy() ClientType { return o }
var ClientTypeMap = map[string]ClientType{
"NONE": 0,
"CLI": 1,
"GUI_MAIN": 2,
"KBFS": 3,
"GUI_HELPER": 4,
}
var ClientTypeRevMap = map[ClientType]string{
0: "NONE",
1: "CLI",
2: "GUI_MAIN",
3: "KBFS",
4: "GUI_HELPER",
}
type KBFSPathInfo struct {
StandardPath string `codec:"standardPath" json:"standardPath"`
DeeplinkPath string `codec:"deeplinkPath" json:"deeplinkPath"`
PlatformAfterMountPath string `codec:"platformAfterMountPath" json:"platformAfterMountPath"`
}
func (o KBFSPathInfo) DeepCopy() KBFSPathInfo {
return KBFSPathInfo{
StandardPath: o.StandardPath,
DeeplinkPath: o.DeeplinkPath,
PlatformAfterMountPath: o.PlatformAfterMountPath,
}
}
type UserVersionVector struct {
Id int64 `codec:"id" json:"id"`
SigHints int `codec:"sigHints" json:"sigHints"`
SigChain int64 `codec:"sigChain" json:"sigChain"`
CachedAt Time `codec:"cachedAt" json:"cachedAt"`
}
func (o UserVersionVector) DeepCopy() UserVersionVector {
return UserVersionVector{
Id: o.Id,
SigHints: o.SigHints,
SigChain: o.SigChain,
CachedAt: o.CachedAt.DeepCopy(),
}
}
type PerUserKeyGeneration int
func (o PerUserKeyGeneration) DeepCopy() PerUserKeyGeneration {
return o
}
type PerUserKey struct {
Gen int `codec:"gen" json:"gen"`
Seqno Seqno `codec:"seqno" json:"seqno"`
SigKID KID `codec:"sigKID" json:"sigKID"`
EncKID KID `codec:"encKID" json:"encKID"`
SignedByKID KID `codec:"signedByKID" json:"signedByKID"`
}
func (o PerUserKey) DeepCopy() PerUserKey {
return PerUserKey{
Gen: o.Gen,
Seqno: o.Seqno.DeepCopy(),
SigKID: o.SigKID.DeepCopy(),
EncKID: o.EncKID.DeepCopy(),
SignedByKID: o.SignedByKID.DeepCopy(),
}
}
type UserPlusKeys struct {
Uid UID `codec:"uid" json:"uid"`
Username string `codec:"username" json:"username"`
EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"`
Status StatusCode `codec:"status" json:"status"`
DeviceKeys []PublicKey `codec:"deviceKeys" json:"deviceKeys"`
RevokedDeviceKeys []RevokedKey `codec:"revokedDeviceKeys" json:"revokedDeviceKeys"`
PGPKeyCount int `codec:"pgpKeyCount" json:"pgpKeyCount"`
Uvv UserVersionVector `codec:"uvv" json:"uvv"`
DeletedDeviceKeys []PublicKey `codec:"deletedDeviceKeys" json:"deletedDeviceKeys"`
PerUserKeys []PerUserKey `codec:"perUserKeys" json:"perUserKeys"`
Resets []ResetSummary `codec:"resets" json:"resets"`
}
func (o UserPlusKeys) DeepCopy() UserPlusKeys {
return UserPlusKeys{
Uid: o.Uid.DeepCopy(),
Username: o.Username,
EldestSeqno: o.EldestSeqno.DeepCopy(),
Status: o.Status.DeepCopy(),
DeviceKeys: (func(x []PublicKey) []PublicKey {
if x == nil {
return nil
}
ret := make([]PublicKey, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.DeviceKeys),
RevokedDeviceKeys: (func(x []RevokedKey) []RevokedKey {
if x == nil {
return nil
}
ret := make([]RevokedKey, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RevokedDeviceKeys),
PGPKeyCount: o.PGPKeyCount,
Uvv: o.Uvv.DeepCopy(),
DeletedDeviceKeys: (func(x []PublicKey) []PublicKey {
if x == nil {
return nil
}
ret := make([]PublicKey, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.DeletedDeviceKeys),
PerUserKeys: (func(x []PerUserKey) []PerUserKey {
if x == nil {
return nil
}
ret := make([]PerUserKey, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.PerUserKeys),
Resets: (func(x []ResetSummary) []ResetSummary {
if x == nil {
return nil
}
ret := make([]ResetSummary, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Resets),
}
}
type UserOrTeamLite struct {
Id UserOrTeamID `codec:"id" json:"id"`
Name string `codec:"name" json:"name"`
}
func (o UserOrTeamLite) DeepCopy() UserOrTeamLite {
return UserOrTeamLite{
Id: o.Id.DeepCopy(),
Name: o.Name,
}
}
type UserOrTeamResult int
const (
UserOrTeamResult_USER UserOrTeamResult = 1
UserOrTeamResult_TEAM UserOrTeamResult = 2
)
func (o UserOrTeamResult) DeepCopy() UserOrTeamResult { return o }
var UserOrTeamResultMap = map[string]UserOrTeamResult{
"USER": 1,
"TEAM": 2,
}
var UserOrTeamResultRevMap = map[UserOrTeamResult]string{
1: "USER",
2: "TEAM",
}
func (e UserOrTeamResult) String() string {
if v, ok := UserOrTeamResultRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type RemoteTrack struct {
Username string `codec:"username" json:"username"`
Uid UID `codec:"uid" json:"uid"`
LinkID LinkID `codec:"linkID" json:"linkID"`
}
func (o RemoteTrack) DeepCopy() RemoteTrack {
return RemoteTrack{
Username: o.Username,
Uid: o.Uid.DeepCopy(),
LinkID: o.LinkID.DeepCopy(),
}
}
type UserPlusAllKeys struct {
Base UserPlusKeys `codec:"base" json:"base"`
PGPKeys []PublicKey `codec:"pgpKeys" json:"pgpKeys"`
RemoteTracks []RemoteTrack `codec:"remoteTracks" json:"remoteTracks"`
}
func (o UserPlusAllKeys) DeepCopy() UserPlusAllKeys {
return UserPlusAllKeys{
Base: o.Base.DeepCopy(),
PGPKeys: (func(x []PublicKey) []PublicKey {
if x == nil {
return nil
}
ret := make([]PublicKey, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.PGPKeys),
RemoteTracks: (func(x []RemoteTrack) []RemoteTrack {
if x == nil {
return nil
}
ret := make([]RemoteTrack, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.RemoteTracks),
}
}
type MerkleTreeID int
const (
MerkleTreeID_MASTER MerkleTreeID = 0
MerkleTreeID_KBFS_PUBLIC MerkleTreeID = 1
MerkleTreeID_KBFS_PRIVATE MerkleTreeID = 2
MerkleTreeID_KBFS_PRIVATETEAM MerkleTreeID = 3
)
func (o MerkleTreeID) DeepCopy() MerkleTreeID { return o }
var MerkleTreeIDMap = map[string]MerkleTreeID{
"MASTER": 0,
"KBFS_PUBLIC": 1,
"KBFS_PRIVATE": 2,
"KBFS_PRIVATETEAM": 3,
}
var MerkleTreeIDRevMap = map[MerkleTreeID]string{
0: "MASTER",
1: "KBFS_PUBLIC",
2: "KBFS_PRIVATE",
3: "KBFS_PRIVATETEAM",
}
// SocialAssertionService is a service that can be used to assert proofs for a
// user.
type SocialAssertionService string
func (o SocialAssertionService) DeepCopy() SocialAssertionService {
return o
}
// SocialAssertion contains a service and username for that service, that
// together form an assertion about a user. It can either be a social
// assertion (like "facebook" or "twitter") or a server trust assertion (like
// "phone" or "email").
//
// If the assertion is for social network, resolving an assertion requires
// that the user posts a Keybase proof on the asserted service as the asserted
// user.
//
// For server trust assertion, we have to trust the server.
type SocialAssertion struct {
User string `codec:"user" json:"user"`
Service SocialAssertionService `codec:"service" json:"service"`
}
func (o SocialAssertion) DeepCopy() SocialAssertion {
return SocialAssertion{
User: o.User,
Service: o.Service.DeepCopy(),
}
}
type FullName string
func (o FullName) DeepCopy() FullName {
return o
}
type FullNamePackageVersion int
const (
FullNamePackageVersion_V0 FullNamePackageVersion = 0
FullNamePackageVersion_V1 FullNamePackageVersion = 1
FullNamePackageVersion_V2 FullNamePackageVersion = 2
)
func (o FullNamePackageVersion) DeepCopy() FullNamePackageVersion { return o }
var FullNamePackageVersionMap = map[string]FullNamePackageVersion{
"V0": 0,
"V1": 1,
"V2": 2,
}
var FullNamePackageVersionRevMap = map[FullNamePackageVersion]string{
0: "V0",
1: "V1",
2: "V2",
}
func (e FullNamePackageVersion) String() string {
if v, ok := FullNamePackageVersionRevMap[e]; ok {
return v
}
return fmt.Sprintf("%v", int(e))
}
type FullNamePackage struct {
Version FullNamePackageVersion `codec:"version" json:"version"`
FullName FullName `codec:"fullName" json:"fullName"`
EldestSeqno Seqno `codec:"eldestSeqno" json:"eldestSeqno"`
Status StatusCode `codec:"status" json:"status"`
CachedAt Time `codec:"cachedAt" json:"cachedAt"`
}
func (o FullNamePackage) DeepCopy() FullNamePackage {
return FullNamePackage{
Version: o.Version.DeepCopy(),
FullName: o.FullName.DeepCopy(),
EldestSeqno: o.EldestSeqno.DeepCopy(),
Status: o.Status.DeepCopy(),
CachedAt: o.CachedAt.DeepCopy(),
}
}
type ImageCropRect struct {
X0 int `codec:"x0" json:"x0"`
Y0 int `codec:"y0" json:"y0"`
X1 int `codec:"x1" json:"x1"`
Y1 int `codec:"y1" json:"y1"`
}
func (o ImageCropRect) DeepCopy() ImageCropRect {
return ImageCropRect{
X0: o.X0,
Y0: o.Y0,
X1: o.X1,
Y1: o.Y1,
}
}
type PhoneLookupResult struct {
Uid UID `codec:"uid" json:"uid"`
Username string `codec:"username" json:"username"`