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" // VolumeTag allow to track resource related to a compose volume VolumeTag = "com.docker.compose.volume" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerSummary ¶ added in v1.0.5
type ContainerSummary struct {
ID string
Name string
Project string
Service string
State string
Publishers []PortPublisher
}
ContainerSummary hold high-level description of a container
type LogConsumer ¶ added in v1.0.4
type LogConsumer interface {
Log(service, container, message string)
}
LogConsumer is a callback to process log messages from services
type PortPublisher ¶
PortPublisher hold status about published port
type Service ¶
type Service interface {
// Build executes the equivalent to a `compose build`
Build(ctx context.Context, project *types.Project) error
// Push executes the equivalent ot a `compose push`
Push(ctx context.Context, project *types.Project) error
// Pull executes the equivalent of a `compose pull`
Pull(ctx context.Context, project *types.Project) error
// Create executes the equivalent to a `compose create`
Create(ctx context.Context, project *types.Project) error
// Start executes the equivalent to a `compose start`
Start(ctx context.Context, project *types.Project, consumer LogConsumer) error
// 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, consumer LogConsumer) error
// Ps executes the equivalent to a `compose ps`
Ps(ctx context.Context, projectName string) ([]ContainerSummary, 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, format string) ([]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
Click to show internal directories.
Click to hide internal directories.