compose

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// STARTING indicates that stack is being deployed
	STARTING string = "Starting"
	// RUNNING indicates that stack is deployed and services are running
	RUNNING string = "Running"
	// UPDATING indicates that some stack resources are being recreated
	UPDATING string = "Updating"
	// REMOVING indicates that stack is being deleted
	REMOVING string = "Removing"
	// UNKNOWN indicates unknown stack state
	UNKNOWN string = "Unknown"
	// FAILED indicates that stack deployment failed
	FAILED string = "Failed"
)
View Source
const (
	// ProjectTag allow to track resource related to a compose project
	ProjectTag = "com.docker.compose.project"
	// NetworkTag allow to track resource related to a compose network
	NetworkTag = "com.docker.compose.network"
	// ServiceTag allow to track resource related to a compose service
	ServiceTag = "com.docker.compose.service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PortPublisher

type PortPublisher struct {
	URL           string
	TargetPort    int
	PublishedPort int
	Protocol      string
}

PortPublisher hold status about published port

type Service

type Service interface {
	// Up executes the equivalent to a `compose up`
	Up(ctx context.Context, project *types.Project, detach bool) error
	// Down executes the equivalent to a `compose down`
	Down(ctx context.Context, projectName string) error
	// Logs executes the equivalent to a `compose logs`
	Logs(ctx context.Context, projectName string, w io.Writer) error
	// Ps executes the equivalent to a `compose ps`
	Ps(ctx context.Context, projectName string) ([]ServiceStatus, error)
	// List executes the equivalent to a `docker stack ls`
	List(ctx context.Context, projectName string) ([]Stack, error)
	// Convert translate compose model into backend's native format
	Convert(ctx context.Context, project *types.Project) ([]byte, error)
}

Service manages a compose project

type ServiceStatus

type ServiceStatus struct {
	ID         string
	Name       string
	Replicas   int
	Desired    int
	Ports      []string
	Publishers []PortPublisher
}

ServiceStatus hold status about a service

type Stack

type Stack struct {
	ID     string
	Name   string
	Status string
	Reason string
}

Stack holds the name and state of a compose application/stack

Jump to

Keyboard shortcuts

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