exec

package
v3.7.0-0.alpha.1.531.0... Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package exec contains a utility to Docker exec into a running a container

Create an ExecHelper with NewExecHelper and then create new exec commands with Command()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExecError

func IsExecError(err error) bool

IsExecError returns true if the given error is an execError

Types

type ExecCommand

type ExecCommand struct {
	// contains filtered or unexported fields
}

ExecCommand is a command to execute with the helper

func (*ExecCommand) CombinedOutput

func (c *ExecCommand) CombinedOutput() (string, error)

CombinedOutput executes the command and returns a single output

func (*ExecCommand) Input

func (c *ExecCommand) Input(in io.Reader) *ExecCommand

Input sets an input reader on the exec command

func (*ExecCommand) Output

func (c *ExecCommand) Output() (string, string, error)

Output executes the command and returns seprate stderr and stdout

func (*ExecCommand) Run

func (c *ExecCommand) Run() error

Run executes the command

type ExecHelper

type ExecHelper struct {
	// contains filtered or unexported fields
}

ExecHelper allows execution of commands on a running Docker container

func NewExecHelper

func NewExecHelper(client dockerhelper.Interface, container string) *ExecHelper

NewExecHelper creates a new ExecHelper

func (*ExecHelper) Command

func (h *ExecHelper) Command(cmd ...string) *ExecCommand

Command creates a new command to execute

Jump to

Keyboard shortcuts

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