containers

package
v1.0.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrContainerNotFound happens when a container.json is not found
	ErrContainerNotFound = errors.New("Container not found")

	// ErrContainerAlreadyExists happens when a container ID already exists
	ErrContainerAlreadyExists = errors.New("Container already exists")

	// ErrInvalidContainerID happens when a container ID is invalid
	ErrInvalidContainerID = errors.New("Invalid container ID")
)

Functions

func GetListFromDirectory

func GetListFromDirectory(root string) ([]string, error)

GetListFromDirectory returns a list of containers on the given diretory

func GetStatus

func GetStatus(projectID, containerID string) string

GetStatus gets the status for a container

func Link(projectID, containerPath string, container *Container) error

Link container to project

func List

func List(projectID string)

List of containers of a given project

func Restart

func Restart(projectID, containerID string)

Restart restarts a container inside a project

func Unlink(projectID, containerID string) error

Unlink container

func Validate

func Validate(projectID, containerID string) (err error)

Validate container

Types

type Container

type Container struct {
	ID           string            `json:"id"`
	Name         string            `json:"name"`
	Port         int               `json:"port,omitempty"`
	State        string            `json:"state,omitempty"`
	Type         string            `json:"type,omitempty"`
	Hooks        *hooks.Hooks      `json:"hooks,omitempty"`
	DeployIgnore []string          `json:"deploy_ignore,omitempty"`
	Env          map[string]string `json:"env,omitempty"`
	Instances    int               `json:"instances,omitempty"`
}

Container structure

func Read

func Read(path string) (*Container, error)

Read a container directory properties (defined by a container.json on it)

type Containers

type Containers map[string]*Container

Containers map

type Register

type Register struct {
	Category         string            `json:"category"`
	ContainerDefault RegisterContainer `json:"containerDefault"`
	Description      string            `json:"description"`
}

Register for the container structure

func GetRegistry

func GetRegistry() (registry []Register)

GetRegistry gets a list of container images

type RegisterContainer

type RegisterContainer struct {
	ID   string            `json:"id"`
	Name string            `json:"name"`
	Type string            `json:"type"`
	Env  map[string]string `json:"env"`
}

RegisterContainer structure for container on register

Jump to

Keyboard shortcuts

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