Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // All returns all existing LXD containers. All() ([]Container, error) // Get returns the LXD container with the given name. Get(name string) (Container, error) // Create creates a container using the LXD image with the given name. Create(image, name string, profiles ...string) (Container, error) // Delete removes the container with the given name. It assumes the // container exists and is not running. Delete(name string) error }
Client describes an LXD client, which is used to create, delete and retrieve LXD containers.
type Container ¶
type Container interface { // Name returns the container name. Name() string // Addr returns the public ip address of the container. Addr() (string, error) // Started reports whether the container is running. Started() bool // Start starts the container. Start() error // Stop stops the container. Stop() error // WriteFile creates a file in the container at the given path and data. WriteFile(path string, data []byte) error // Exec executes the given command in the container and returns its output. Exec(command string, args ...string) (string, error) }
Container describes an LXD container instance.
Click to show internal directories.
Click to hide internal directories.