Documentation ¶
Overview ¶
Package ssh provides an implemention of an Driver driver for executing jobs on.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶
type Driver struct { io.Writer Addr string // Addr is the full address (including port) of the server. User string // User is the user to use for SSH. Password string // Password is the password to use for the SSH user. Timeout time.Duration // Timeout is the duration for connection timeouts. // contains filtered or unexported fields }
Driver provides an implementation of the runner.Driver interface for SSH connections.
func (*Driver) Create ¶
func (s *Driver) Create(c context.Context, env []string, objs runner.Passthrough, p runner.Placer) error
Create opens up the Driver connection to the remote machine as configured via a previous call to Init. The given env slice is used to set an unexported variable for setting environment variables during job execution.
func (*Driver) Execute ¶
Execute will perform the given runner.Job. This turns it into a shell script that is executed on the remote machine once placed via SFTP. Before the job is executed however, the environment variables given via Create are set for the Driver session being used to invoke the script. The stderr, and stdout streams are forwarded to the underlying io.Writer.
func (*Driver) PlaceObjects ¶
PlaceObjects copies the given objects from the given placer onto the environment via SFTP.