forked from keybase/client
/
notify_paperkey.go
52 lines (45 loc) · 1.4 KB
/
notify_paperkey.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
// Auto-generated by avdl-compiler v1.3.1 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/notify_paperkey.avdl
package keybase1
import (
rpc "github.com/keybase/go-framed-msgpack-rpc"
context "golang.org/x/net/context"
)
type PaperKeyCachedArg struct {
Uid UID `codec:"uid" json:"uid"`
EncKID KID `codec:"encKID" json:"encKID"`
SigKID KID `codec:"sigKID" json:"sigKID"`
}
type NotifyPaperKeyInterface interface {
PaperKeyCached(context.Context, PaperKeyCachedArg) error
}
func NotifyPaperKeyProtocol(i NotifyPaperKeyInterface) rpc.Protocol {
return rpc.Protocol{
Name: "keybase.1.NotifyPaperKey",
Methods: map[string]rpc.ServeHandlerDescription{
"paperKeyCached": {
MakeArg: func() interface{} {
ret := make([]PaperKeyCachedArg, 1)
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
typedArgs, ok := args.(*[]PaperKeyCachedArg)
if !ok {
err = rpc.NewTypeError((*[]PaperKeyCachedArg)(nil), args)
return
}
err = i.PaperKeyCached(ctx, (*typedArgs)[0])
return
},
MethodType: rpc.MethodNotify,
},
},
}
}
type NotifyPaperKeyClient struct {
Cli rpc.GenericClient
}
func (c NotifyPaperKeyClient) PaperKeyCached(ctx context.Context, __arg PaperKeyCachedArg) (err error) {
err = c.Cli.Notify(ctx, "keybase.1.NotifyPaperKey.paperKeyCached", []interface{}{__arg})
return
}