Documentation
¶
Index ¶
- func BuildFileToUnitName(filePath string) string
- func ContainerFileToUnitName(filePath string) string
- func ImageFileToUnitName(filePath string) string
- func MatchAllContainers(projectName string, state deploy.ProjectState, arg string) []string
- func MatchFirstContainer(projectName string, state deploy.ProjectState, arg string) string
- func MatchQuadletResource(projectName string, state deploy.ProjectState, arg string) string
- func NetworkFileToUnitName(filePath string) string
- func VolumeFileToUnitName(filePath string) string
- type ContainerInfo
- type Orchestrator
- func (o *Orchestrator) Down(removeVolumes bool, dryRun bool) error
- func (o *Orchestrator) Edit(projectArg string, noReload bool) error
- func (o *Orchestrator) Exec(service string, user string, tty bool, command []string) error
- func (o *Orchestrator) FollowLogs(since, tail string, showTime bool) error
- func (o *Orchestrator) List() error
- func (o *Orchestrator) Logs(services []string, follow bool, tail, since string, showTime bool) error
- func (o *Orchestrator) Ps(all bool) error
- func (o *Orchestrator) Regenerate(dryRun bool) error
- func (o *Orchestrator) Restart(services []string, dryRun bool) error
- func (o *Orchestrator) Start(services []string, dryRun bool) error
- func (o *Orchestrator) Stop(services []string, dryRun bool) error
- func (o *Orchestrator) Up(pullStrategy string, follow bool, dryRun bool) error
- func (o *Orchestrator) View(projectArg string) error
- type PortInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFileToUnitName ¶ added in v0.1.3
BuildFileToUnitName derives the systemd unit name from a build quadlet file path. e.g. /path/to/cq-myapp-app.build -> cq-myapp-app-build.service
func ContainerFileToUnitName ¶
ContainerFileToUnitName derives the systemd unit name from a quadlet file path. e.g. /path/to/cq-myapp-web.container -> cq-myapp-web.service
func ImageFileToUnitName ¶ added in v0.1.3
ImageFileToUnitName derives the systemd unit name from an image quadlet file path. e.g. /path/to/cq-myapp-app.image -> cq-myapp-app-image.service
func MatchAllContainers ¶
func MatchAllContainers(projectName string, state deploy.ProjectState, arg string) []string
MatchAllContainers finds all container quadlet files matching arg. Uses the same six matching patterns as MatchFirstContainer but returns all matches instead of just the first.
func MatchFirstContainer ¶
func MatchFirstContainer(projectName string, state deploy.ProjectState, arg string) string
MatchFirstContainer finds the first container quadlet file matching arg. Six patterns are tried: exact base name, name without extension, name without .service suffix, short name (strip cq-<project>- prefix), internal Podman name (strip cq- prefix), ContainerName= directive.
func MatchQuadletResource ¶ added in v0.1.3
func MatchQuadletResource(projectName string, state deploy.ProjectState, arg string) string
MatchQuadletResource finds a network, volume, image, or build quadlet file matching the given arg.
func NetworkFileToUnitName ¶
NetworkFileToUnitName derives the systemd unit name from a network quadlet file path. e.g. /path/to/cq-myapp-default.network -> cq-myapp-default-network.service
func VolumeFileToUnitName ¶
VolumeFileToUnitName derives the systemd unit name from a volume quadlet file path. e.g. /path/to/cq-myapp-data.volume -> cq-myapp-data-volume.service
Types ¶
type ContainerInfo ¶
type ContainerInfo struct {
Name string
Image string
Command string
Service string
State string
Status string
Ports []PortInfo
ExposedPorts []string
Networks []string
Mounts []string
CreatedAt time.Time
ExitedAt time.Time
ExitCode int
DBusActive string
DBusSub string
}
ContainerInfo holds parsed podman ps JSON data for a single container.
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator wires all internal packages together and drives the lifecycle of a comquad project.
func NewOrchestrator ¶
func NewOrchestrator(projectName string) (*Orchestrator, error)
NewOrchestrator creates a new Orchestrator for the current working directory.
func (*Orchestrator) Down ¶
func (o *Orchestrator) Down(removeVolumes bool, dryRun bool) error
Down stops all units, removes quadlet files, removes networks, and unregisters the project. If removeVolumes is true, also removes Podman volumes.
func (*Orchestrator) Edit ¶
func (o *Orchestrator) Edit(projectArg string, noReload bool) error
Edit opens project units or a specific unit file in the editor. If noReload is false, systemd is reloaded and units are restarted after changes.
func (*Orchestrator) FollowLogs ¶
func (o *Orchestrator) FollowLogs(since, tail string, showTime bool) error
FollowLogs streams all journalctl logs for every unit in the project from the given timestamp onward.
func (*Orchestrator) List ¶
func (o *Orchestrator) List() error
List prints all currently deployed projects and their files
func (*Orchestrator) Logs ¶
func (o *Orchestrator) Logs(services []string, follow bool, tail, since string, showTime bool) error
Logs prints logs for a deployed project's services via journalctl.
func (*Orchestrator) Ps ¶
func (o *Orchestrator) Ps(all bool) error
Ps shows the current state of containers for the project.
func (*Orchestrator) Regenerate ¶
func (o *Orchestrator) Regenerate(dryRun bool) error
Regenerate scans Podman for managed resources and reconstructs the state file. When dryRun is true, it prints what would be written without saving the state file.
func (*Orchestrator) Restart ¶
func (o *Orchestrator) Restart(services []string, dryRun bool) error
Restart restarts all units for the project, or specific services if provided.
func (*Orchestrator) Start ¶
func (o *Orchestrator) Start(services []string, dryRun bool) error
Start starts all units for the project, or specific services if provided.
func (*Orchestrator) Stop ¶
func (o *Orchestrator) Stop(services []string, dryRun bool) error
Stop stops all units for the project, or specific services if provided.
func (*Orchestrator) Up ¶
func (o *Orchestrator) Up(pullStrategy string, follow bool, dryRun bool) error
Up preprocesses, transpiles, cooks and deploys the project defined in the compose.yaml in the current working directory.
func (*Orchestrator) View ¶
func (o *Orchestrator) View(projectArg string) error
View shows systemd units for a project or the contents of a specific unit file.