Documentation
¶
Index ¶
- Variables
- func AddDomain(ctx context.Context, projectID, serviceID string, domain string) (err error)
- func Link(ctx context.Context, projectID string, container Container, source string) (err error)
- func RemoveDomain(ctx context.Context, projectID string, serviceID, domain string) (err error)
- func Restart(ctx context.Context, projectID, serviceID string) error
- func SetEnvironmentVariable(ctx context.Context, projectID, containerID, key, value string) error
- func Unlink(ctx context.Context, projectID, containerID string) error
- func UnsetEnvironmentVariable(ctx context.Context, projectID, containerID, key string) error
- func Validate(ctx context.Context, projectID, containerID string) (err error)
- type Container
- type ContainerInfo
- type ContainerInfoList
- type ContainerPackage
- type Containers
- type EnvironmentVariable
- type Register
Constants ¶
This section is empty.
Variables ¶
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") // ErrEmptyProjectID happens when trying to access a project, but providing an empty ID ErrEmptyProjectID = errors.New("Can not get project: Project ID is empty") // ErrEmptyContainerID happens when trying to access a container, but providing an empty ID ErrEmptyContainerID = errors.New("Can not get container: Container ID is empty") // ErrEmptyProjectAndContainerID happens when trying to access a container, but providing empty IDs ErrEmptyProjectAndContainerID = errors.New("Can not get container: Project and Container ID is empty") )
Functions ¶
func RemoveDomain ¶
RemoveDomain in project
func SetEnvironmentVariable ¶
SetEnvironmentVariable sets an environment variable
func UnsetEnvironmentVariable ¶
UnsetEnvironmentVariable removes an environment variable
Types ¶
type Container ¶
type Container struct {
ServiceID string `json:"serviceId,omitempty"`
Health string `json:"health,omitempty"`
Type string `json:"type,omitempty"`
Hooks *hooks.Hooks `json:"hooks,omitempty"`
CustomDomains []string `json:"customDomains,omitempty"`
Env map[string]string `json:"env,omitempty"`
Scale int `json:"scale,omitempty"`
HealthUID string `json:"healthUid,omitempty"`
}
Container structure
type ContainerInfo ¶
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 ContainerPackage ¶
type ContainerPackage struct {
ID string `json:"id,omitempty"`
Scale int `json:"scale,omitempty"`
Type string `json:"type,omitempty"`
Hooks *hooks.Hooks `json:"hooks,omitempty"`
CustomDomains []string `json:"customDomains,omitempty"`
Env map[string]string `json:"env,omitempty"`
}
ContainerPackage is the structure for container.json
func Read ¶
func Read(path string) (*ContainerPackage, error)
Read a container directory properties (defined by a container.json on it)
func (ContainerPackage) Container ¶
func (cp ContainerPackage) Container() *Container
Container returns a Container type created taking container.json as base
type Containers ¶
type Containers []Container
Containers list
type EnvironmentVariable ¶
type EnvironmentVariable struct {
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
EnvironmentVariable of a container
func GetEnvironmentVariables ¶
func GetEnvironmentVariables(ctx context.Context, projectID, containerID string) (envs []EnvironmentVariable, err error)
GetEnvironmentVariables of a service