Documentation
¶
Index ¶
- Variables
- func FindComposeFile(dir string) (string, bool)
- type ContainerDetail
- type Manager
- func (m *Manager) ContainerDetails(stackNames []string) (map[string][]ContainerDetail, error)
- func (m *Manager) DiscoverStacks() ([]Stack, error)
- func (m *Manager) Down(stackNames []string, removeVolumes bool) error
- func (m *Manager) EnsureSharedNetwork() error
- func (m *Manager) Logs(stackName string, follow bool, tail string) error
- func (m *Manager) Pull(stackNames []string) error
- func (m *Manager) Status(stackNames []string) ([]Stack, error)
- func (m *Manager) Up(stackNames []string, envName string, detach, build bool) error
- type Publisher
- type RegisteredStack
- type Stack
Constants ¶
This section is empty.
Variables ¶
var ComposeFilenames = []string{
"docker-compose.yml",
"docker-compose.yaml",
"compose.yml",
"compose.yaml",
}
ComposeFilenames is the autodetection probe order for stack root paths.
Functions ¶
func FindComposeFile ¶ added in v1.62.0
FindComposeFile returns the first compose file found directly inside dir.
Types ¶
type ContainerDetail ¶ added in v1.28.0
type ContainerDetail struct {
ID string `json:"ID"`
Name string `json:"Name"`
Service string `json:"Service"`
State string `json:"State"`
Status string `json:"Status"`
Health string `json:"Health"`
Image string `json:"Image"`
Publishers []Publisher `json:"Publishers"`
}
ContainerDetail holds full metadata for an individual container.
type Manager ¶
type Manager struct {
BasePath string
Registered []RegisteredStack
}
Manager handles Docker Compose stack operations.
func NewManager ¶
NewManager creates a new containers Manager targeting the specified base path.
func NewManagerWithStacks ¶ added in v1.62.0
func NewManagerWithStacks(basePath string, registered []RegisteredStack) *Manager
NewManagerWithStacks creates a Manager with additional user-registered stacks.
func (*Manager) ContainerDetails ¶ added in v1.28.0
func (m *Manager) ContainerDetails(stackNames []string) (map[string][]ContainerDetail, error)
ContainerDetails returns detailed container information for target stack(s).
func (*Manager) DiscoverStacks ¶
DiscoverStacks scans the containers path for valid Compose files, plus any user-registered named stacks (arbitrary local root paths, autodetected).
func (*Manager) EnsureSharedNetwork ¶
EnsureSharedNetwork checks if eng-shared-net exists, creating it if necessary.
type Publisher ¶ added in v1.28.0
type Publisher struct {
URL string `json:"URL"`
TargetPort int `json:"TargetPort"`
PublishedPort int `json:"PublishedPort"`
Protocol string `json:"Protocol"`
}
Publisher represents port forwarding mappings from docker compose ps json.
type RegisteredStack ¶ added in v1.62.0
RegisteredStack is a pure-data DTO for a user-registered named stack. The compose file is autodetected inside Path at discovery time.
type Stack ¶
type Stack struct {
Name string `json:"name"`
Path string `json:"path"`
File string `json:"file"`
Services []string `json:"services"`
Status string `json:"status"`
Containers int `json:"containers"`
// Source is "registered" for user-registered named stacks and
// "discovered" for stacks found under BasePath. It is informational only.
Source string `json:"source"`
}
Stack represents a Docker Compose stack definition.