github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/keybase1/notify_ephemeral.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/notify_ephemeral.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 NewTeamEkArg struct { 13 Id TeamID `codec:"id" json:"id"` 14 Generation EkGeneration `codec:"generation" json:"generation"` 15 } 16 17 type NewTeambotEkArg struct { 18 Id TeamID `codec:"id" json:"id"` 19 Generation EkGeneration `codec:"generation" json:"generation"` 20 } 21 22 type TeambotEkNeededArg struct { 23 Id TeamID `codec:"id" json:"id"` 24 Uid UID `codec:"uid" json:"uid"` 25 Generation EkGeneration `codec:"generation" json:"generation"` 26 ForceCreateGeneration *EkGeneration `codec:"forceCreateGeneration,omitempty" json:"forceCreateGeneration,omitempty"` 27 } 28 29 type NotifyEphemeralInterface interface { 30 NewTeamEk(context.Context, NewTeamEkArg) error 31 NewTeambotEk(context.Context, NewTeambotEkArg) error 32 TeambotEkNeeded(context.Context, TeambotEkNeededArg) error 33 } 34 35 func NotifyEphemeralProtocol(i NotifyEphemeralInterface) rpc.Protocol { 36 return rpc.Protocol{ 37 Name: "keybase.1.NotifyEphemeral", 38 Methods: map[string]rpc.ServeHandlerDescription{ 39 "newTeamEk": { 40 MakeArg: func() interface{} { 41 var ret [1]NewTeamEkArg 42 return &ret 43 }, 44 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 45 typedArgs, ok := args.(*[1]NewTeamEkArg) 46 if !ok { 47 err = rpc.NewTypeError((*[1]NewTeamEkArg)(nil), args) 48 return 49 } 50 err = i.NewTeamEk(ctx, typedArgs[0]) 51 return 52 }, 53 }, 54 "newTeambotEk": { 55 MakeArg: func() interface{} { 56 var ret [1]NewTeambotEkArg 57 return &ret 58 }, 59 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 60 typedArgs, ok := args.(*[1]NewTeambotEkArg) 61 if !ok { 62 err = rpc.NewTypeError((*[1]NewTeambotEkArg)(nil), args) 63 return 64 } 65 err = i.NewTeambotEk(ctx, typedArgs[0]) 66 return 67 }, 68 }, 69 "teambotEkNeeded": { 70 MakeArg: func() interface{} { 71 var ret [1]TeambotEkNeededArg 72 return &ret 73 }, 74 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 75 typedArgs, ok := args.(*[1]TeambotEkNeededArg) 76 if !ok { 77 err = rpc.NewTypeError((*[1]TeambotEkNeededArg)(nil), args) 78 return 79 } 80 err = i.TeambotEkNeeded(ctx, typedArgs[0]) 81 return 82 }, 83 }, 84 }, 85 } 86 } 87 88 type NotifyEphemeralClient struct { 89 Cli rpc.GenericClient 90 } 91 92 func (c NotifyEphemeralClient) NewTeamEk(ctx context.Context, __arg NewTeamEkArg) (err error) { 93 err = c.Cli.Notify(ctx, "keybase.1.NotifyEphemeral.newTeamEk", []interface{}{__arg}, 0*time.Millisecond) 94 return 95 } 96 97 func (c NotifyEphemeralClient) NewTeambotEk(ctx context.Context, __arg NewTeambotEkArg) (err error) { 98 err = c.Cli.Call(ctx, "keybase.1.NotifyEphemeral.newTeambotEk", []interface{}{__arg}, nil, 0*time.Millisecond) 99 return 100 } 101 102 func (c NotifyEphemeralClient) TeambotEkNeeded(ctx context.Context, __arg TeambotEkNeededArg) (err error) { 103 err = c.Cli.Call(ctx, "keybase.1.NotifyEphemeral.teambotEkNeeded", []interface{}{__arg}, nil, 0*time.Millisecond) 104 return 105 }