github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/secret_ui.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/secret_ui.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 SecretEntryArg struct { 13 Desc string `codec:"desc" json:"desc"` 14 Prompt string `codec:"prompt" json:"prompt"` 15 Err string `codec:"err" json:"err"` 16 Cancel string `codec:"cancel" json:"cancel"` 17 Ok string `codec:"ok" json:"ok"` 18 Reason string `codec:"reason" json:"reason"` 19 ShowTyping bool `codec:"showTyping" json:"showTyping"` 20 } 21 22 func (o SecretEntryArg) DeepCopy() SecretEntryArg { 23 return SecretEntryArg{ 24 Desc: o.Desc, 25 Prompt: o.Prompt, 26 Err: o.Err, 27 Cancel: o.Cancel, 28 Ok: o.Ok, 29 Reason: o.Reason, 30 ShowTyping: o.ShowTyping, 31 } 32 } 33 34 type SecretEntryRes struct { 35 Text string `codec:"text" json:"text"` 36 Canceled bool `codec:"canceled" json:"canceled"` 37 StoreSecret bool `codec:"storeSecret" json:"storeSecret"` 38 } 39 40 func (o SecretEntryRes) DeepCopy() SecretEntryRes { 41 return SecretEntryRes{ 42 Text: o.Text, 43 Canceled: o.Canceled, 44 StoreSecret: o.StoreSecret, 45 } 46 } 47 48 type GetPassphraseArg struct { 49 SessionID int `codec:"sessionID" json:"sessionID"` 50 Pinentry GUIEntryArg `codec:"pinentry" json:"pinentry"` 51 Terminal *SecretEntryArg `codec:"terminal,omitempty" json:"terminal,omitempty"` 52 } 53 54 type SecretUiInterface interface { 55 GetPassphrase(context.Context, GetPassphraseArg) (GetPassphraseRes, error) 56 } 57 58 func SecretUiProtocol(i SecretUiInterface) rpc.Protocol { 59 return rpc.Protocol{ 60 Name: "keybase.1.secretUi", 61 Methods: map[string]rpc.ServeHandlerDescription{ 62 "getPassphrase": { 63 MakeArg: func() interface{} { 64 var ret [1]GetPassphraseArg 65 return &ret 66 }, 67 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 68 typedArgs, ok := args.(*[1]GetPassphraseArg) 69 if !ok { 70 err = rpc.NewTypeError((*[1]GetPassphraseArg)(nil), args) 71 return 72 } 73 ret, err = i.GetPassphrase(ctx, typedArgs[0]) 74 return 75 }, 76 }, 77 }, 78 } 79 } 80 81 type SecretUiClient struct { 82 Cli rpc.GenericClient 83 } 84 85 func (c SecretUiClient) GetPassphrase(ctx context.Context, __arg GetPassphraseArg) (res GetPassphraseRes, err error) { 86 err = c.Cli.Call(ctx, "keybase.1.secretUi.getPassphrase", []interface{}{__arg}, &res, 0*time.Millisecond) 87 return 88 }