loader

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package loader reads workflow YAML files and their referenced compose files/assets into an ir.LoadedDefinition. The I/O front for validation: file reads happen here so validation itself can be pure over an already-loaded snapshot.

Paths declared by containers, imports, and assets go through two independent gates:

  1. safeRootRelPath rejects absolute paths, paths containing backslashes (manifest paths are slash-separated; silently rewriting them hides authoring mistakes), control characters, and paths that escape the workflow directory after path.Clean.
  2. os.Root (Go 1.24, rooted at the workflow directory) independently confines all opens to the workflow directory. Root follows inside-root symlinks, so Load explicitly rejects symlink path components before opening files.

Load also normalizes each Container.Compose to its cleaned forward-slash form so the IR field and the ComposeFiles map key agree (this matters for the spec §E compose-fold and for any caller looking up bytes by container).

Index

Constants

View Source
const MaxAssetFileBytes int64 = 64 << 20
View Source
const MaxAssetFiles = 10000
View Source
const MaxAssetTotalBytes int64 = 256 << 20

Variables

This section is empty.

Functions

func Load

func Load(workflowPath string) (*ir.LoadedDefinition, error)

Load reads the root workflow file at workflowPath, parses it into the IR, reads each referenced compose file and asset snapshot, then recursively loads local workflow imports. Root-level Workflow, WorkflowPath, ComposeFiles, and Assets fields remain aliases for the root module.

Types

type LoadError

type LoadError struct {
	Code    string
	Source  string
	Path    string
	Message string
	Err     error
}

func (*LoadError) Error

func (e *LoadError) Error() string

func (*LoadError) Unwrap

func (e *LoadError) Unwrap() error

Jump to

Keyboard shortcuts

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