mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
36d0a50427
This is part of a general effort to move all of Terraform's non-library package surface under internal in order to reinforce that these are for internal use within Terraform only. If you were previously importing packages under this prefix into an external codebase, you could pin to an earlier release tag as an interim solution until you've make a plan to achieve the same functionality some other way.
30 lines
546 B
Go
30 lines
546 B
Go
package plugin
|
|
|
|
import (
|
|
"net/rpc"
|
|
|
|
"github.com/hashicorp/terraform/internal/terraform"
|
|
)
|
|
|
|
// UIOutput is an implementatin of terraform.UIOutput that communicates
|
|
// over RPC.
|
|
type UIOutput struct {
|
|
Client *rpc.Client
|
|
}
|
|
|
|
func (o *UIOutput) Output(v string) {
|
|
o.Client.Call("Plugin.Output", v, new(interface{}))
|
|
}
|
|
|
|
// UIOutputServer is the RPC server for serving UIOutput.
|
|
type UIOutputServer struct {
|
|
UIOutput terraform.UIOutput
|
|
}
|
|
|
|
func (s *UIOutputServer) Output(
|
|
v string,
|
|
reply *interface{}) error {
|
|
s.UIOutput.Output(v)
|
|
return nil
|
|
}
|