forked from keybase/client
/
identify3_ui.go
374 lines (335 loc) · 10.5 KB
/
identify3_ui.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
// Auto-generated by avdl-compiler v1.4.0 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/keybase1/identify3_ui.avdl
package keybase1
import (
"github.com/keybase/go-framed-msgpack-rpc/rpc"
context "golang.org/x/net/context"
)
type Identify3RowState int
const (
Identify3RowState_CHECKING Identify3RowState = 1
Identify3RowState_VALID Identify3RowState = 2
Identify3RowState_ERROR Identify3RowState = 3
Identify3RowState_WARNING Identify3RowState = 4
Identify3RowState_REVOKED Identify3RowState = 5
)
func (o Identify3RowState) DeepCopy() Identify3RowState { return o }
var Identify3RowStateMap = map[string]Identify3RowState{
"CHECKING": 1,
"VALID": 2,
"ERROR": 3,
"WARNING": 4,
"REVOKED": 5,
}
var Identify3RowStateRevMap = map[Identify3RowState]string{
1: "CHECKING",
2: "VALID",
3: "ERROR",
4: "WARNING",
5: "REVOKED",
}
func (e Identify3RowState) String() string {
if v, ok := Identify3RowStateRevMap[e]; ok {
return v
}
return ""
}
type Identify3RowColor int
const (
Identify3RowColor_BLUE Identify3RowColor = 1
Identify3RowColor_RED Identify3RowColor = 2
Identify3RowColor_BLACK Identify3RowColor = 3
Identify3RowColor_GREEN Identify3RowColor = 4
Identify3RowColor_GRAY Identify3RowColor = 5
Identify3RowColor_YELLOW Identify3RowColor = 6
Identify3RowColor_ORANGE Identify3RowColor = 7
)
func (o Identify3RowColor) DeepCopy() Identify3RowColor { return o }
var Identify3RowColorMap = map[string]Identify3RowColor{
"BLUE": 1,
"RED": 2,
"BLACK": 3,
"GREEN": 4,
"GRAY": 5,
"YELLOW": 6,
"ORANGE": 7,
}
var Identify3RowColorRevMap = map[Identify3RowColor]string{
1: "BLUE",
2: "RED",
3: "BLACK",
4: "GREEN",
5: "GRAY",
6: "YELLOW",
7: "ORANGE",
}
func (e Identify3RowColor) String() string {
if v, ok := Identify3RowColorRevMap[e]; ok {
return v
}
return ""
}
type Identify3ResultType int
const (
Identify3ResultType_OK Identify3ResultType = 0
Identify3ResultType_BROKEN Identify3ResultType = 1
Identify3ResultType_NEEDS_UPGRADE Identify3ResultType = 2
Identify3ResultType_CANCELED Identify3ResultType = 3
)
func (o Identify3ResultType) DeepCopy() Identify3ResultType { return o }
var Identify3ResultTypeMap = map[string]Identify3ResultType{
"OK": 0,
"BROKEN": 1,
"NEEDS_UPGRADE": 2,
"CANCELED": 3,
}
var Identify3ResultTypeRevMap = map[Identify3ResultType]string{
0: "OK",
1: "BROKEN",
2: "NEEDS_UPGRADE",
3: "CANCELED",
}
func (e Identify3ResultType) String() string {
if v, ok := Identify3ResultTypeRevMap[e]; ok {
return v
}
return ""
}
type Identify3RowMeta struct {
Color Identify3RowColor `codec:"color" json:"color"`
Label string `codec:"label" json:"label"`
}
func (o Identify3RowMeta) DeepCopy() Identify3RowMeta {
return Identify3RowMeta{
Color: o.Color.DeepCopy(),
Label: o.Label,
}
}
type Identify3Row struct {
GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
Key string `codec:"key" json:"key"`
Value string `codec:"value" json:"value"`
Priority int `codec:"priority" json:"priority"`
SiteURL string `codec:"siteURL" json:"siteURL"`
SiteIcon []SizedImage `codec:"siteIcon" json:"siteIcon"`
SiteIconFull []SizedImage `codec:"siteIconFull" json:"siteIconFull"`
ProofURL string `codec:"proofURL" json:"proofURL"`
SigID SigID `codec:"sigID" json:"sigID"`
Ctime Time `codec:"ctime" json:"ctime"`
State Identify3RowState `codec:"state" json:"state"`
Metas []Identify3RowMeta `codec:"metas" json:"metas"`
Color Identify3RowColor `codec:"color" json:"color"`
Kid *KID `codec:"kid,omitempty" json:"kid,omitempty"`
}
func (o Identify3Row) DeepCopy() Identify3Row {
return Identify3Row{
GuiID: o.GuiID.DeepCopy(),
Key: o.Key,
Value: o.Value,
Priority: o.Priority,
SiteURL: o.SiteURL,
SiteIcon: (func(x []SizedImage) []SizedImage {
if x == nil {
return nil
}
ret := make([]SizedImage, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.SiteIcon),
SiteIconFull: (func(x []SizedImage) []SizedImage {
if x == nil {
return nil
}
ret := make([]SizedImage, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.SiteIconFull),
ProofURL: o.ProofURL,
SigID: o.SigID.DeepCopy(),
Ctime: o.Ctime.DeepCopy(),
State: o.State.DeepCopy(),
Metas: (func(x []Identify3RowMeta) []Identify3RowMeta {
if x == nil {
return nil
}
ret := make([]Identify3RowMeta, len(x))
for i, v := range x {
vCopy := v.DeepCopy()
ret[i] = vCopy
}
return ret
})(o.Metas),
Color: o.Color.DeepCopy(),
Kid: (func(x *KID) *KID {
if x == nil {
return nil
}
tmp := (*x).DeepCopy()
return &tmp
})(o.Kid),
}
}
type Identify3ShowTrackerArg struct {
GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
Assertion Identify3Assertion `codec:"assertion" json:"assertion"`
Reason IdentifyReason `codec:"reason" json:"reason"`
ForceDisplay bool `codec:"forceDisplay" json:"forceDisplay"`
}
type Identify3UpdateRowArg struct {
Row Identify3Row `codec:"row" json:"row"`
}
type Identify3UserResetArg struct {
GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
}
type Identify3UpdateUserCardArg struct {
GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
Card UserCard `codec:"card" json:"card"`
}
type Identify3TrackerTimedOutArg struct {
GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
}
type Identify3ResultArg struct {
GuiID Identify3GUIID `codec:"guiID" json:"guiID"`
Result Identify3ResultType `codec:"result" json:"result"`
}
type Identify3UiInterface interface {
Identify3ShowTracker(context.Context, Identify3ShowTrackerArg) error
Identify3UpdateRow(context.Context, Identify3Row) error
Identify3UserReset(context.Context, Identify3GUIID) error
Identify3UpdateUserCard(context.Context, Identify3UpdateUserCardArg) error
Identify3TrackerTimedOut(context.Context, Identify3GUIID) error
Identify3Result(context.Context, Identify3ResultArg) error
}
func Identify3UiProtocol(i Identify3UiInterface) rpc.Protocol {
return rpc.Protocol{
Name: "keybase.1.identify3Ui",
Methods: map[string]rpc.ServeHandlerDescription{
"identify3ShowTracker": {
MakeArg: func() interface{} {
var ret [1]Identify3ShowTrackerArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
typedArgs, ok := args.(*[1]Identify3ShowTrackerArg)
if !ok {
err = rpc.NewTypeError((*[1]Identify3ShowTrackerArg)(nil), args)
return
}
err = i.Identify3ShowTracker(ctx, typedArgs[0])
return
},
},
"identify3UpdateRow": {
MakeArg: func() interface{} {
var ret [1]Identify3UpdateRowArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
typedArgs, ok := args.(*[1]Identify3UpdateRowArg)
if !ok {
err = rpc.NewTypeError((*[1]Identify3UpdateRowArg)(nil), args)
return
}
err = i.Identify3UpdateRow(ctx, typedArgs[0].Row)
return
},
},
"identify3UserReset": {
MakeArg: func() interface{} {
var ret [1]Identify3UserResetArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
typedArgs, ok := args.(*[1]Identify3UserResetArg)
if !ok {
err = rpc.NewTypeError((*[1]Identify3UserResetArg)(nil), args)
return
}
err = i.Identify3UserReset(ctx, typedArgs[0].GuiID)
return
},
},
"identify3UpdateUserCard": {
MakeArg: func() interface{} {
var ret [1]Identify3UpdateUserCardArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
typedArgs, ok := args.(*[1]Identify3UpdateUserCardArg)
if !ok {
err = rpc.NewTypeError((*[1]Identify3UpdateUserCardArg)(nil), args)
return
}
err = i.Identify3UpdateUserCard(ctx, typedArgs[0])
return
},
},
"identify3TrackerTimedOut": {
MakeArg: func() interface{} {
var ret [1]Identify3TrackerTimedOutArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
typedArgs, ok := args.(*[1]Identify3TrackerTimedOutArg)
if !ok {
err = rpc.NewTypeError((*[1]Identify3TrackerTimedOutArg)(nil), args)
return
}
err = i.Identify3TrackerTimedOut(ctx, typedArgs[0].GuiID)
return
},
},
"identify3Result": {
MakeArg: func() interface{} {
var ret [1]Identify3ResultArg
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
typedArgs, ok := args.(*[1]Identify3ResultArg)
if !ok {
err = rpc.NewTypeError((*[1]Identify3ResultArg)(nil), args)
return
}
err = i.Identify3Result(ctx, typedArgs[0])
return
},
},
},
}
}
type Identify3UiClient struct {
Cli rpc.GenericClient
}
func (c Identify3UiClient) Identify3ShowTracker(ctx context.Context, __arg Identify3ShowTrackerArg) (err error) {
err = c.Cli.Call(ctx, "keybase.1.identify3Ui.identify3ShowTracker", []interface{}{__arg}, nil)
return
}
func (c Identify3UiClient) Identify3UpdateRow(ctx context.Context, row Identify3Row) (err error) {
__arg := Identify3UpdateRowArg{Row: row}
err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3UpdateRow", []interface{}{__arg})
return
}
func (c Identify3UiClient) Identify3UserReset(ctx context.Context, guiID Identify3GUIID) (err error) {
__arg := Identify3UserResetArg{GuiID: guiID}
err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3UserReset", []interface{}{__arg})
return
}
func (c Identify3UiClient) Identify3UpdateUserCard(ctx context.Context, __arg Identify3UpdateUserCardArg) (err error) {
err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3UpdateUserCard", []interface{}{__arg})
return
}
func (c Identify3UiClient) Identify3TrackerTimedOut(ctx context.Context, guiID Identify3GUIID) (err error) {
__arg := Identify3TrackerTimedOutArg{GuiID: guiID}
err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3TrackerTimedOut", []interface{}{__arg})
return
}
func (c Identify3UiClient) Identify3Result(ctx context.Context, __arg Identify3ResultArg) (err error) {
err = c.Cli.Notify(ctx, "keybase.1.identify3Ui.identify3Result", []interface{}{__arg})
return
}