github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/identify3.go (about) 1 // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler) 2 // Input file: avdl/keybase1/identify3.avdl 3 4 package keybase1 5 6 import ( 7 "github.com/keybase/go-framed-msgpack-rpc/rpc" 8 context "golang.org/x/net/context" 9 "time" 10 ) 11 12 type Identify3Arg struct { 13 Assertion Identify3Assertion `codec:"assertion" json:"assertion"` 14 GuiID Identify3GUIID `codec:"guiID" json:"guiID"` 15 IgnoreCache bool `codec:"ignoreCache" json:"ignoreCache"` 16 } 17 18 type Identify3FollowUserArg struct { 19 GuiID Identify3GUIID `codec:"guiID" json:"guiID"` 20 Follow bool `codec:"follow" json:"follow"` 21 } 22 23 type Identify3IgnoreUserArg struct { 24 GuiID Identify3GUIID `codec:"guiID" json:"guiID"` 25 } 26 27 type Identify3Interface interface { 28 Identify3(context.Context, Identify3Arg) error 29 Identify3FollowUser(context.Context, Identify3FollowUserArg) error 30 Identify3IgnoreUser(context.Context, Identify3GUIID) error 31 } 32 33 func Identify3Protocol(i Identify3Interface) rpc.Protocol { 34 return rpc.Protocol{ 35 Name: "keybase.1.identify3", 36 Methods: map[string]rpc.ServeHandlerDescription{ 37 "identify3": { 38 MakeArg: func() interface{} { 39 var ret [1]Identify3Arg 40 return &ret 41 }, 42 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 43 typedArgs, ok := args.(*[1]Identify3Arg) 44 if !ok { 45 err = rpc.NewTypeError((*[1]Identify3Arg)(nil), args) 46 return 47 } 48 err = i.Identify3(ctx, typedArgs[0]) 49 return 50 }, 51 }, 52 "identify3FollowUser": { 53 MakeArg: func() interface{} { 54 var ret [1]Identify3FollowUserArg 55 return &ret 56 }, 57 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 58 typedArgs, ok := args.(*[1]Identify3FollowUserArg) 59 if !ok { 60 err = rpc.NewTypeError((*[1]Identify3FollowUserArg)(nil), args) 61 return 62 } 63 err = i.Identify3FollowUser(ctx, typedArgs[0]) 64 return 65 }, 66 }, 67 "identify3IgnoreUser": { 68 MakeArg: func() interface{} { 69 var ret [1]Identify3IgnoreUserArg 70 return &ret 71 }, 72 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 73 typedArgs, ok := args.(*[1]Identify3IgnoreUserArg) 74 if !ok { 75 err = rpc.NewTypeError((*[1]Identify3IgnoreUserArg)(nil), args) 76 return 77 } 78 err = i.Identify3IgnoreUser(ctx, typedArgs[0].GuiID) 79 return 80 }, 81 }, 82 }, 83 } 84 } 85 86 type Identify3Client struct { 87 Cli rpc.GenericClient 88 } 89 90 func (c Identify3Client) Identify3(ctx context.Context, __arg Identify3Arg) (err error) { 91 err = c.Cli.Call(ctx, "keybase.1.identify3.identify3", []interface{}{__arg}, nil, 0*time.Millisecond) 92 return 93 } 94 95 func (c Identify3Client) Identify3FollowUser(ctx context.Context, __arg Identify3FollowUserArg) (err error) { 96 err = c.Cli.Call(ctx, "keybase.1.identify3.identify3FollowUser", []interface{}{__arg}, nil, 0*time.Millisecond) 97 return 98 } 99 100 func (c Identify3Client) Identify3IgnoreUser(ctx context.Context, guiID Identify3GUIID) (err error) { 101 __arg := Identify3IgnoreUserArg{GuiID: guiID} 102 err = c.Cli.Call(ctx, "keybase.1.identify3.identify3IgnoreUser", []interface{}{__arg}, nil, 0*time.Millisecond) 103 return 104 }