7 "github.com/hashicorp/go-plugin"
8 "github.com/hashicorp/terraform/terraform"
11 // UIInput is an implementation of terraform.UIInput that communicates
17 func (i *UIInput) Input(ctx context.Context, opts *terraform.InputOpts) (string, error) {
18 var resp UIInputInputResponse
19 err := i.Client.Call("Plugin.Input", opts, &resp)
23 if resp.Error != nil {
28 return resp.Value, nil
31 type UIInputInputResponse struct {
33 Error *plugin.BasicError
36 // UIInputServer is a net/rpc compatible structure for serving
37 // a UIInputServer. This should not be used directly.
38 type UIInputServer struct {
39 UIInput terraform.UIInput
42 func (s *UIInputServer) Input(
43 opts *terraform.InputOpts,
44 reply *UIInputInputResponse) error {
45 value, err := s.UIInput.Input(context.Background(), opts)
46 *reply = UIInputInputResponse{
48 Error: plugin.NewBasicError(err),