preprocess

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSELinuxEnabled

func IsSELinuxEnabled() bool

IsSELinuxEnabled returns true if SELinux is detected as enabled on the host.

func SELinuxMode

func SELinuxMode() string

SELinuxMode returns the detected SELinux mode string. Possible values: "Enforcing", "Permissive", "Disabled", "Unknown".

func SetSELinuxOverrides

func SetSELinuxOverrides(enabled *bool, mode string)

SetSELinuxOverrides overrides the SELinux detection result for testing. Pass nil for enabled to restore filesystem-based detection.

Types

type ComposeFile

type ComposeFile struct {
	Services map[string]map[string]interface{} `yaml:"services"`
	Networks map[string]interface{}            `yaml:"networks,omitempty"`
	Volumes  map[string]map[string]interface{} `yaml:"volumes,omitempty"`
	Config   *ProjectConfig                    `yaml:"-"` // Internal use
}

ComposeFile represents the top-level structure of a docker-compose.yaml. Services and Volumes use generic maps to preserve all fields (including unknown ones like depends_on, restart, etc.) through the unmarshal/marshal cycle.

type Engine

type Engine struct {
	ProjectName      string
	WorkingDirectory string
}

Engine handles the pre-processing of Compose files

func NewEngine

func NewEngine(projectName string, workingDir string) *Engine

NewEngine creates a new pre-processing engine

func (*Engine) Process

func (e *Engine) Process(input []byte) ([]byte, error)

Process takes a raw YAML input and applies normalization rules. It also extracts build configuration from services.

type ProjectConfig

type ProjectConfig struct {
	ProjectName      string
	WorkingDirectory string
}

ProjectConfig holds metadata injected during pre-processing

type StringMap

type StringMap map[string]string

StringMap stores key-value pairs and supports both YAML map and list formats during unmarshaling (e.g. `KEY: value` or `- KEY=value`). During marshaling it always outputs as a list, which is the standard Docker Compose format and what downstream tools like podlet expect.

func (StringMap) MarshalYAML

func (sm StringMap) MarshalYAML() (interface{}, error)

func (*StringMap) UnmarshalYAML

func (sm *StringMap) UnmarshalYAML(node *yaml.Node) error

Jump to

Keyboard shortcuts

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