multidocker

package
v0.0.0-...-24a58ed Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// HostConfigJSONFile is the basename for the HostConfig JSON.
	HostConfigJSONFile = "config.v0.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host interface {
	Config() HostConfig
	Dir() (string, error)
	Create() error
	URL() (string, error)
	State() (State, error)
	Remove() error
	Start() error
	Stop() error
}

Host is similar to Docker Machine's Driver.

func NewHost

func NewHost(config HostConfig, dir string) (Host, error)

NewHost create a host with config. dir must be an absolute path.

type HostConfig

type HostConfig struct {
	// name of the host. e.g. "foobar"
	Name string `json:"name"`

	// storage driver
	EngineStorageDriver string `json:"engine_storage_driver"`
}

HostConfig is a config JSON for a host.

type Provisioner

type Provisioner interface {
	Install(Host) error
}

Provisioner installs Docker Engine to a host.

func NewBundleProvisioner

func NewBundleProvisioner(bundlePath string) (Provisioner, error)

NewBundleProvisioner instantiates a provisioner for the bundle.

type State

type State int

State represents the state of a host

const (
	// UnknownState is an unknown state.
	UnknownState State = iota
	// Running denotes that the host is running.
	Running
	// Stopped denotes that the host is not running.
	Stopped
)

func (State) String

func (s State) String() string

type Store

type Store interface {
	StorePath() string
	Host(string) (Host, error)
	Hosts() ([]Host, error)
	AllocateHostDir(string) (string, error)
	RegisterHost(Host) error
}

Store is the root directory for a multidocker environment.

func DefaultStore

func DefaultStore() Store

DefaultStore uses /var/lib/multidocker as the store.

Jump to

Keyboard shortcuts

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