Documentation
¶
Overview ¶
godocker - Go package to interact with Linux Containers (LXC) through docker
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerHome ¶
FIXME glxc tests compliant but "what the fuck" regarding c.containerHome() ?
Types ¶
type Container ¶
type Container interface {
// Name returns the name of the container.
Name() string
// After creation, change Name() to docker container id
SetId(id string)
// Create creates a new container based on the given template.
Create(configFile, template string, templateArgs ...string) error
// Start runs the container as a daemon.
Start(configFile, consoleFile string) error
// Stop terminates the running container.
Stop() error
// Clone creates a copy of the container, giving the copy the specified name.
Clone(name string) (Container, error)
// Freeze freezes all the container's processes.
Freeze() error
// Unfreeze thaws all frozen container's processes.
Unfreeze() error
// Destroy stops and removes the container.
Destroy() error
// Wait waits for one of the specified container states.
Wait(states ...State) error
// Info returns the status and the process id of the container.
Info() (State, int, error)
// IsConstructed checks if the container image exists.
IsConstructed() bool
// IsRunning checks if the state of the container is 'RUNNING'.
IsRunning() bool
// String returns information about the container, like the name, state,
// and process id.
String() string
// LogFile returns the current filename used for the LogFile.
LogFile() string
// LogLevel returns the current logging level (only used if the
// LogFile is not "").
LogLevel() LogLevel
// SetLogFile sets both the LogFile and LogLevel.
SetLogFile(filename string, level LogLevel)
// Get container informations
GetKeyInfo(key string) (interface{}, error)
// contains filtered or unexported methods
}
Container represents a linux container instance and provides operations to create, maintain and destroy the container.
type ContainerFactory ¶
type ContainerFactory interface {
// New returns a container instance which can then be used for operations
// like Create(), Start(), Stop() or Destroy().
New(string) Container
// List returns all the existing containers on the system.
List() ([]Container, error)
}
ContainerFactory represents the methods used to create Containers.
Click to show internal directories.
Click to hide internal directories.