forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth_update.go
51 lines (44 loc) · 1.39 KB
/
auth_update.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
// Auto-generated by avdl-compiler v1.3.12 (https://github.com/keybase/node-avdl-compiler)
// Input file: avdl/gregor1/auth_update.avdl
package gregor1
import (
"github.com/keybase/go-framed-msgpack-rpc/rpc"
context "golang.org/x/net/context"
)
type RevokeSessionIDsArg struct {
SessionIDs []SessionID `codec:"sessionIDs" json:"sessionIDs"`
}
type AuthUpdateInterface interface {
RevokeSessionIDs(context.Context, []SessionID) error
}
func AuthUpdateProtocol(i AuthUpdateInterface) rpc.Protocol {
return rpc.Protocol{
Name: "gregor.1.authUpdate",
Methods: map[string]rpc.ServeHandlerDescription{
"revokeSessionIDs": {
MakeArg: func() interface{} {
ret := make([]RevokeSessionIDsArg, 1)
return &ret
},
Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) {
typedArgs, ok := args.(*[]RevokeSessionIDsArg)
if !ok {
err = rpc.NewTypeError((*[]RevokeSessionIDsArg)(nil), args)
return
}
err = i.RevokeSessionIDs(ctx, (*typedArgs)[0].SessionIDs)
return
},
MethodType: rpc.MethodCall,
},
},
}
}
type AuthUpdateClient struct {
Cli rpc.GenericClient
}
func (c AuthUpdateClient) RevokeSessionIDs(ctx context.Context, sessionIDs []SessionID) (err error) {
__arg := RevokeSessionIDsArg{SessionIDs: sessionIDs}
err = c.Cli.Call(ctx, "gregor.1.authUpdate.revokeSessionIDs", []interface{}{__arg}, nil)
return
}