Documentation
¶
Overview ¶
Package exec runs commands. Docker operations go through the local docker CLI against a per-server Docker context (transport, builds, PTYs are the CLI's problem); plain SSH via the system ssh binary remains for non-Docker host chores. Both come with the user's ~/.ssh/config, agent auth, and host key verification for free.
Links to servers are assumed flaky: every SSH connection ferry spawns gets keepalives generous enough to ride out multi-minute stalls, and short docker control commands retry transparently on transient transport errors (a fresh connection typically works even while established flows are stalled).
Index ¶
- func Interactive(args ...string) error
- func Run(args ...string) (string, error)
- func RunInput(input []byte, args ...string) (string, error)
- func RunReader(r io.Reader, args ...string) (string, error)
- func RunRetry(fn func() (string, error)) (string, error)
- func Stream(args ...string) error
- func StreamTo(w io.Writer, args ...string) error
- func Transient(err error) bool
- type Docker
- type Host
- func (h *Host) Interactive(command string) error
- func (h *Host) Run(command string) (string, error)
- func (h *Host) RunInput(input []byte, command string) (string, error)
- func (h *Host) RunReader(r io.Reader, command string) (string, error)
- func (h *Host) Stream(command string) error
- func (h *Host) StreamTo(w io.Writer, command string) error
- func (h *Host) WriteFile(path string, content []byte, mode string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Interactive ¶
Interactive executes a local command wired to the terminal, stdin included.
func RunInput ¶
RunInput executes a local command with input on stdin (for secrets that must not appear in argv) and returns its combined output.
func RunReader ¶
RunReader executes a local command with stdin streamed from r (context tarballs, file content) and returns its combined output.
func RunRetry ¶
RunRetry runs fn, retrying on Transient errors with backoff. Non-transient errors return immediately.
Types ¶
type Docker ¶
Docker runs docker CLI invocations against one server's context.
func (*Docker) Interactive ¶
Interactive wires the command to the terminal (for exec -it, logs -f).
type Host ¶
Host runs plain SSH commands on a server for non-Docker chores: provisioning, mkdir, shipping env files, hooks, the lock dir, the audit log.
func (*Host) Interactive ¶
Interactive opens an interactive session (or command) with a PTY.