common

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWgetCmd

func BuildWgetCmd(d *schema.ResourceData, m interface{}, destination string) []string

func CreateBastionConfig

func CreateBastionConfig(d *schema.ResourceData) (*ssh.ClientConfig, error)

func CreateSSHConfig

func CreateSSHConfig(d *schema.ResourceData, m interface{}) (*ssh.ClientConfig, error)

func DownloadRemoteFile

func DownloadRemoteFile(d *schema.ResourceData, m interface{}) error

Determines what commands are possible and downloads a file to a remote system.

func ErrorMessage

func ErrorMessage(d *schema.ResourceData, msg string, err_msg string) string

func GenUUID

func GenUUID() string

func HandleSourceAndDest

func HandleSourceAndDest(d *schema.ResourceData, m interface{}) error

Determines if, how, and where to transfer the source script

func LocalExec

func LocalExec(d *schema.ResourceData, program []string, query map[string]interface{}) ([]byte, error)

Contains the base function for executing a command locally. Helper method to RunScript

func MakeRequest

func MakeRequest(d *schema.ResourceData, m interface{}, method string) (string, error)

func RemoteExec

func RemoteExec(d *schema.ResourceData, program []string, query map[string]interface{}, config *ssh.ClientConfig) ([]byte, error)

Contains the base function for executing a command remotely. Helper method to RunRemoteScript

func RunRemoteScript

func RunRemoteScript(d *schema.ResourceData, m interface{}) (map[string]string, error)

Transfers (if applicable) and executes a command or script on a remote system

func RunScript

func RunScript(d *schema.ResourceData, m interface{}) (map[string]string, error)

Runs a script and returns the output and/or an error if it fails. If the script returns JSON (recommended) it will be loaded into a map and returned If the script returns a String, the String will be returned

func SubErrorMessage

func SubErrorMessage(d *schema.ResourceData, msg string, err_msg string) string

Like ErrorMessage but without the stars. Use when a parent method is going to use ErrorMessage to wrap your error

func TraceMessage

func TraceMessage(d *schema.ResourceData, msg string) string

func TraceMessagef

func TraceMessagef(d *schema.ResourceData, fmt string, msg string)

func TransferLocalToRemote

func TransferLocalToRemote(d *schema.ResourceData, m interface{}, localSource string) error

Helper function to transfer files from the local file system to a remote file system

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL