orchestrator

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFileToUnitName added in v0.1.3

func BuildFileToUnitName(filePath string) string

func ContainerFileToUnitName

func ContainerFileToUnitName(filePath string) string

func ImageFileToUnitName added in v0.1.3

func ImageFileToUnitName(filePath string) string

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

func NetworkFileToUnitName(filePath string) string

func VolumeFileToUnitName

func VolumeFileToUnitName(filePath string) string

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
}

func NewOrchestrator

func NewOrchestrator(projectName string) (*Orchestrator, error)

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) Exec

func (o *Orchestrator) Exec(service string, user string, tty bool, command []string) error

Exec runs a command inside a single running container via podman exec.

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) ProjectName added in v0.1.4

func (o *Orchestrator) ProjectName() string

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, noDiff bool) error

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.

type PortInfo

type PortInfo struct {
	Protocol      string
	ContainerPort int
	HostIP        string
	HostPort      int
}

PortInfo holds published port mapping for a container.

type PullStrategy added in v0.3.0

type PullStrategy string
const (
	PullAlways  PullStrategy = "always"
	PullMissing PullStrategy = "missing"
	PullNever   PullStrategy = "never"
)

func ParsePullStrategy added in v0.3.0

func ParsePullStrategy(s string) (PullStrategy, error)

Jump to

Keyboard shortcuts

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