shellutils

package
v0.0.0-...-b6284df Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShellOptions

type ShellOptions struct {
	Shell    string   `json:"shell,omitempty"`
	In       string   `json:"in,omitempty"`
	Ins      []string `json:"ins,omitempty"`
	Env      []string `json:"env,omitempty"`
	Timeout  int      `json:"timeout,omitempty"`
	SecretID string   `json:"secretId,omitempty"`
}

ShellOptions how to run the a shell command

func DefaultBashCommandOptions

func DefaultBashCommandOptions() ShellOptions

DefaultBashCommandOptions default for running with bash

type ShellResult

type ShellResult struct {
	Code int    `json:"code,omitempty"`
	Out  string `json:"out,omitempty"`
	Err  string `json:"err,omitempty"`
}

ShellResult reponse of the shell action

func RunRemoteShell

func RunRemoteShell(sshConf ShellSSHConfig, cmd string) (*ShellResult, error)

RunRemoteShell execute a command on remote shell

func RunShellCommand

func RunShellCommand(commandToRun string, cmdOpt ...ShellOptions) (*ShellResult, error)

RunShellCommand execute a command using the shell

type ShellSSHConfig

type ShellSSHConfig struct {
	Address        string `json:"address,omitempty"`
	User           string `json:"user,omitempty"`
	Password       string `json:"password,omitempty"`
	PrivateKeyFile string `json:"privateKeyFile,omitempty"`
	Passphrase     string `json:"passphrase,omitempty"`
	SecretID       string `json:"secretId,omitempty"`
}

ShellSSHConfig connection configuration

Jump to

Keyboard shortcuts

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