Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Spec ¶ added in v1.30.0
func Spec() actionspec.Spec
Spec declares the ssh action. It keeps to no guard, as it does not check what it is about to do against one, so that a guard refuses it unless it is allowed by name. It cannot run without host, user and cmd, and password or key_file, to log in with.
Types ¶
type Option ¶
type Option func(*Callback)
func WithEnvRefused ¶
WithEnvRefused is called for each environment variable the server refuses to set, typically because sshd_config does not list it in AcceptEnv. The command still runs, without that variable.
type Req ¶
type Req struct {
Host string `map:"host" validate:"required"`
Port int `map:"port"`
User string `map:"user" validate:"required"`
Cmd string `map:"cmd" validate:"required"`
Password string `map:"password"`
KeyFile string `map:"key_file"`
KeyPassphrase string `map:"key_passphrase"`
Timeout string `map:"timeout"`
Workdir string `map:"workdir"`
Env map[string]string `map:"env"`
StrictHostCheck bool `map:"strict_host_check"`
KnownHosts string `map:"known_hosts"`
// contains filtered or unexported fields
}
type Res ¶
type Res struct {
Code int `map:"code"`
Stdout string `map:"stdout"`
Stderr string `map:"stderr"`
// TimedOut is true when the command was stopped at the timeout. Code is
// then the status it exited with once signalled, or -1 when it did not
// stop, and Stdout and Stderr hold what it wrote until then.
TimedOut bool `map:"timed_out"`
}