containers

package
v1.0.0-alpha-87 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2017 License: MIT Imports: 17 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 Link(ctx context.Context, projectID, containerID, containerPath string) error

Link container to project

func Restart

func Restart(ctx context.Context, projectID, containerID string) error

Restart restarts a container inside a project

func SetEnvironmentVariable

func SetEnvironmentVariable(ctx context.Context, projectID, containerID, key, value string) error

SetEnvironmentVariable sets an environment variable

func Unlink(ctx context.Context, projectID, containerID string) error

Unlink container

func UnsetEnvironmentVariable

func UnsetEnvironmentVariable(ctx context.Context, projectID, containerID, key string) error

UnsetEnvironmentVariable removes an environment variable

func Validate

func Validate(ctx context.Context, projectID, containerID string) (err error)

Validate container

Types

type Container

type Container struct {
	ID     string            `json:"id"`
	Health string            `json:"health,omitempty"`
	Type   string            `json:"type,omitempty"`
	Hooks  *hooks.Hooks      `json:"hooks,omitempty"`
	Env    map[string]string `json:"env,omitempty"`
	Scale  int               `json:"scale,omitempty"`
}

Container structure

func Get

func Get(ctx context.Context, projectID, containerID string) (Container, error)

Get container

func Read

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

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

type ContainerInfo

type ContainerInfo struct {
	ID       string
	Location string
}

ContainerInfo is for a tuple of container ID and Location.

type ContainerInfoList

type ContainerInfoList []ContainerInfo

ContainerInfoList is a list of ContainerInfo

func GetListFromDirectory

func GetListFromDirectory(root string) (ContainerInfoList, error)

GetListFromDirectory returns a list of containers on the given diretory

func (ContainerInfoList) GetIDs

func (c ContainerInfoList) GetIDs() []string

GetIDs returns the containers ids of a given ContainerInfoList.

func (ContainerInfoList) GetLocations

func (c ContainerInfoList) GetLocations() []string

GetLocations returns the locations of a given ContainerInfoList.

type Containers

type Containers map[string]*Container

Containers map

func List

func List(ctx context.Context, projectID string) (Containers, error)

List containers of a given project

type Register

type Register struct {
	ID          string `json:"id"`
	Type        string `json:"type"`
	Category    string `json:"category"`
	Description string `json:"description"`
}

Register for the container structure

func GetRegistry

func GetRegistry(ctx context.Context) (registry []Register, err error)

GetRegistry gets a list of container images

Jump to

Keyboard shortcuts

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