Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface { // Init initializes the connection Init(ctx context.Context) error // Close closes the connection Close(ctx context.Context) error // PutFile copies a file from src to dst with mode. PutFile(ctx context.Context, src []byte, dst string, mode fs.FileMode) error // FetchFile copies a file from src to dst writer. FetchFile(ctx context.Context, src string, dst io.Writer) error // ExecuteCommand executes a command on the remote host ExecuteCommand(ctx context.Context, cmd string) ([]byte, error) }
Connector is the interface for connecting to a remote host
func NewConnector ¶
NewConnector creates a new connector if set connector to "local", use local connector if set connector to "ssh", use ssh connector if set connector to "kubernetes", use kubernetes connector if connector is not set. when host is localhost, use local connector, else use ssh connector vars contains all inventory for host. It's best to define the connector info in inventory file.
Click to show internal directories.
Click to hide internal directories.