compose

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package compose provides Docker Compose project processing functionality

Package compose provides Docker Compose file parsing and handling

Index

Constants

This section is empty.

Variables

View Source
var (
	ProcessUnit          ProcessUnitFunc          = processUnit
	CleanupOrphanedUnits CleanupOrphanedUnitsFunc = cleanupOrphanedUnits
	WriteUnitFile        WriteUnitFileFunc        = fs.WriteUnitFile
	UpdateUnitDatabase   UpdateUnitDatabaseFunc   = updateUnitDatabase
)

Package variables for testing.

Functions

func LabelConverter added in v0.9.0

func LabelConverter(labels types.Labels) []string

LabelConverter converts compose-style labels to unit labels.

func NameResolver added in v0.9.0

func NameResolver(definedName, keyName string) string

NameResolver resolves resource names from compose configs.

func OptionsConverter added in v0.9.0

func OptionsConverter(opts map[string]string) []string

OptionsConverter converts driver options to unit options.

func ParseComposeFile

func ParseComposeFile(path string) (*types.Project, error)

ParseComposeFile parses a Docker Compose file at the specified path.

func ProcessProjects added in v0.16.1

func ProcessProjects(projects []*types.Project, force bool, existingProcessedUnits map[string]bool, doCleanup bool, repoConfig *config.Repository) (map[string]bool, error)

ProcessProjects processes Docker Compose projects and converts them to Podman systemd units. It accepts an existing processedUnits map to track units across multiple repository calls and a cleanup flag to control when orphaned unit cleanup should occur.

func ReadProjects

func ReadProjects(path string) ([]*types.Project, error)

ReadProjects reads all Docker Compose projects from a directory path.

Types

type CleanupOrphanedUnitsFunc added in v0.16.1

type CleanupOrphanedUnitsFunc func(unitRepo repository.Repository, processedUnits map[string]bool) error

CleanupOrphanedUnitsFunc is the function signature for cleaning up orphaned units.

type ProcessUnitFunc added in v0.16.1

type ProcessUnitFunc func(unitRepo repository.Repository, unitItem *unit.QuadletUnit, force bool, processedUnits map[string]bool, changedUnits *[]unit.QuadletUnit, repoConfig *config.Repository) error

ProcessUnitFunc is the function signature for processing a single quadlet unit.

type UpdateUnitDatabaseFunc added in v0.16.1

type UpdateUnitDatabaseFunc func(unitRepo repository.Repository, unitItem *unit.QuadletUnit, content string, repoConfig *config.Repository) error

UpdateUnitDatabaseFunc is the function signature for updating the unit database.

type WriteUnitFileFunc added in v0.16.1

type WriteUnitFileFunc func(unitPath, content string) error

WriteUnitFileFunc is the function signature for writing a unit file.

Jump to

Keyboard shortcuts

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