Documentation ¶
Index ¶
- func Retry(ctx context.Context, f func() error) error
- type Communicator
- type Fatal
- type MockCommunicator
- func (c *MockCommunicator) Connect(o terraform.UIOutput) error
- func (c *MockCommunicator) Disconnect() error
- func (c *MockCommunicator) ScriptPath() string
- func (c *MockCommunicator) Start(r *remote.Cmd) error
- func (c *MockCommunicator) Timeout() time.Duration
- func (c *MockCommunicator) Upload(path string, input io.Reader) error
- func (c *MockCommunicator) UploadDir(dst string, src string) error
- func (c *MockCommunicator) UploadScript(path string, input io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Communicator ¶
type Communicator interface { // Connect is used to setup the connection Connect(terraform.UIOutput) error // Disconnect is used to terminate the connection Disconnect() error // Timeout returns the configured connection timeout Timeout() time.Duration // ScriptPath returns the configured script path ScriptPath() string // Start executes a remote command in a new session Start(*remote.Cmd) error // Upload is used to upload a single file Upload(string, io.Reader) error // UploadScript is used to upload a file as an executable script UploadScript(string, io.Reader) error // UploadDir is used to upload a directory UploadDir(string, string) error }
Communicator is an interface that must be implemented by all communicators used for any of the provisioners
func New ¶
func New(s *terraform.InstanceState) (Communicator, error)
New returns a configured Communicator or an error if the connection type is not supported
type Fatal ¶ added in v0.11.4
type Fatal interface {
FatalError() error
}
Fatal is an interface that error values can return to halt Retry
type MockCommunicator ¶ added in v0.5.1
type MockCommunicator struct { RemoteScriptPath string Commands map[string]bool Uploads map[string]string UploadScripts map[string]string UploadDirs map[string]string CommandFunc func(*remote.Cmd) error DisconnectFunc func() error ConnTimeout time.Duration }
MockCommunicator is an implementation of Communicator that can be used for tests.
func (*MockCommunicator) Connect ¶ added in v0.5.1
func (c *MockCommunicator) Connect(o terraform.UIOutput) error
Connect implementation of communicator.Communicator interface
func (*MockCommunicator) Disconnect ¶ added in v0.5.1
func (c *MockCommunicator) Disconnect() error
Disconnect implementation of communicator.Communicator interface
func (*MockCommunicator) ScriptPath ¶ added in v0.5.1
func (c *MockCommunicator) ScriptPath() string
ScriptPath implementation of communicator.Communicator interface
func (*MockCommunicator) Start ¶ added in v0.5.1
func (c *MockCommunicator) Start(r *remote.Cmd) error
Start implementation of communicator.Communicator interface
func (*MockCommunicator) Timeout ¶ added in v0.5.1
func (c *MockCommunicator) Timeout() time.Duration
Timeout implementation of communicator.Communicator interface
func (*MockCommunicator) Upload ¶ added in v0.5.1
func (c *MockCommunicator) Upload(path string, input io.Reader) error
Upload implementation of communicator.Communicator interface
func (*MockCommunicator) UploadDir ¶ added in v0.5.1
func (c *MockCommunicator) UploadDir(dst string, src string) error
UploadDir implementation of communicator.Communicator interface
func (*MockCommunicator) UploadScript ¶ added in v0.5.1
func (c *MockCommunicator) UploadScript(path string, input io.Reader) error
UploadScript implementation of communicator.Communicator interface