container

package
v0.0.0-...-7f3230f Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OSExec

func OSExec(prog string, args ...string) (string, error)

OSExec executes a command and return the string output or an error

Types

type CmdRunner

type CmdRunner func(prog string, args ...string) (string, error)

CmdRunner is used to mock OSExec

type Container

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

Container interface that other compatible container software, such as Docker, LXC, Rocket should implement

type Docker

type Docker struct {
	Container
	// contains filtered or unexported fields
}

Docker struct to implement the Container interface

func NewDocker

func NewDocker(containerID string, cr CmdRunner) (d *Docker)

NewDocker creates a new docker

func (*Docker) Inspect

func (d *Docker) Inspect() (err error)

Inspect uses docker inspect command to fetch information about the container

func (*Docker) IsRunning

func (d *Docker) IsRunning() (err error)

IsRunning checks to ensure a container is currently running (not stopped/paused)

func (*Docker) IsValid

func (d *Docker) IsValid() (err error)

IsValid performs basic checks of container ID to ensure ID is valid before being used

type IPPort

type IPPort struct {
	// Port number that should be published for external access
	PublicPort uint16
	// Private Port container is listening for requests on
	PrivatePort uint16
	// Protocol used by port, such as tcp
	Proto string
}

IPPort mapping for a container's published or expose ports

type Reader

type Reader interface {
	IsRunning() error
}

Jump to

Keyboard shortcuts

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