docker

package
Version: v0.0.0-...-d1f9a5c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StdWriterPrefixLen = 8
	StdWriterFdIndex   = 0
	StdWriterSizeIndex = 4
)

Variables

View Source
var (
	ErrTimeout = errors.New("Timeout")
	ErrLogging = errors.New("Logs not available")
)
View Source
var ErrInvalidStdHeader = errors.New("Unrecognized input header")

Functions

func StdCopy

func StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error)

StdCopy is a modified version of io.Copy.

StdCopy will demultiplex `src`, assuming that it contains two streams, previously multiplexed together using a StdWriter instance. As it reads from `src`, StdCopy will write to `dstout` and `dsterr`.

StdCopy will read until it hits EOF on `src`. It will then return a nil error. In other words: if `err` is non nil, it indicates a real underlying error.

`written` will hold the total number of bytes written to `dstout` and `dsterr`.

Types

type Client

type Client struct {
	dockerclient.Client
	// contains filtered or unexported fields
}

Client is a wrapper around the default Docker client that tracks all created containers ensures some default configurations are in place.

func NewClient

func NewClient(docker dockerclient.Client) (*Client, error)

func (*Client) CreateContainer

func (c *Client) CreateContainer(conf *dockerclient.ContainerConfig, name string, auth *dockerclient.AuthConfig) (string, error)

CreateContainer creates a container and internally caches its container id.

func (*Client) Destroy

func (c *Client) Destroy() error

Destroy will terminate and destroy all containers that were created by this client.

func (*Client) StartContainer

func (c *Client) StartContainer(id string, conf *dockerclient.HostConfig) error

StartContainer starts a container and links to an ambassador container sharing the build machiens volume.

type StdType

type StdType [StdWriterPrefixLen]byte
var (
	Stdin  StdType = StdType{0: 0}
	Stdout StdType = StdType{0: 1}
	Stderr StdType = StdType{0: 2}
)

type StdWriter

type StdWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL