github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/keybase1/notify_audit.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_audit.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 RootAuditErrorArg struct { 13 Message string `codec:"message" json:"message"` 14 } 15 16 type BoxAuditErrorArg struct { 17 Message string `codec:"message" json:"message"` 18 } 19 20 type NotifyAuditInterface interface { 21 RootAuditError(context.Context, string) error 22 BoxAuditError(context.Context, string) error 23 } 24 25 func NotifyAuditProtocol(i NotifyAuditInterface) rpc.Protocol { 26 return rpc.Protocol{ 27 Name: "keybase.1.NotifyAudit", 28 Methods: map[string]rpc.ServeHandlerDescription{ 29 "rootAuditError": { 30 MakeArg: func() interface{} { 31 var ret [1]RootAuditErrorArg 32 return &ret 33 }, 34 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 35 typedArgs, ok := args.(*[1]RootAuditErrorArg) 36 if !ok { 37 err = rpc.NewTypeError((*[1]RootAuditErrorArg)(nil), args) 38 return 39 } 40 err = i.RootAuditError(ctx, typedArgs[0].Message) 41 return 42 }, 43 }, 44 "boxAuditError": { 45 MakeArg: func() interface{} { 46 var ret [1]BoxAuditErrorArg 47 return &ret 48 }, 49 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 50 typedArgs, ok := args.(*[1]BoxAuditErrorArg) 51 if !ok { 52 err = rpc.NewTypeError((*[1]BoxAuditErrorArg)(nil), args) 53 return 54 } 55 err = i.BoxAuditError(ctx, typedArgs[0].Message) 56 return 57 }, 58 }, 59 }, 60 } 61 } 62 63 type NotifyAuditClient struct { 64 Cli rpc.GenericClient 65 } 66 67 func (c NotifyAuditClient) RootAuditError(ctx context.Context, message string) (err error) { 68 __arg := RootAuditErrorArg{Message: message} 69 err = c.Cli.Notify(ctx, "keybase.1.NotifyAudit.rootAuditError", []interface{}{__arg}, 0*time.Millisecond) 70 return 71 } 72 73 func (c NotifyAuditClient) BoxAuditError(ctx context.Context, message string) (err error) { 74 __arg := BoxAuditErrorArg{Message: message} 75 err = c.Cli.Notify(ctx, "keybase.1.NotifyAudit.boxAuditError", []interface{}{__arg}, 0*time.Millisecond) 76 return 77 }