6 "github.com/hashicorp/go-plugin"
7 "github.com/hashicorp/terraform/terraform"
10 // UIInput is an implementatin of terraform.UIInput that communicates
16 func (i *UIInput) Input(opts *terraform.InputOpts) (string, error) {
17 var resp UIInputInputResponse
18 err := i.Client.Call("Plugin.Input", opts, &resp)
22 if resp.Error != nil {
27 return resp.Value, nil
30 type UIInputInputResponse struct {
32 Error *plugin.BasicError
35 // UIInputServer is a net/rpc compatible structure for serving
36 // a UIInputServer. This should not be used directly.
37 type UIInputServer struct {
38 UIInput terraform.UIInput
41 func (s *UIInputServer) Input(
42 opts *terraform.InputOpts,
43 reply *UIInputInputResponse) error {
44 value, err := s.UIInput.Input(opts)
45 *reply = UIInputInputResponse{
47 Error: plugin.NewBasicError(err),