loader

package
v1.74.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileWrongExtension is returned when a file has an unexpected extension for a batch hook
	ErrFileWrongExtension = errors.New("file has wrong extension")
	// ErrFileNotBatchHook is returned when a file doesn't respond correctly to "hook list"
	ErrFileNotBatchHook = errors.New("file is not batch hook")
	// ErrFileNotExecutable is returned when a hook file lacks executable permissions
	ErrFileNotExecutable = errors.New("no executable permissions, chmod +x is required to run this hook")
)
View Source
var (
	// ErrPackageNotFound is returned when the requested package directory doesn't exist
	ErrPackageNotFound = errors.New("package not found")
)

Functions

This section is empty.

Types

type ApplicationInstance

type ApplicationInstance struct {
	Name      string // Unique name of the application instance
	Namespace string // Kubernetes namespace where the application is deployed
	Package   string // Package name (directory name under appsDir)
	Version   string // Package version (directory name under package)
}

ApplicationInstance represents a deployed application instance. It contains the metadata needed to locate and load the corresponding package.

type ApplicationLoader

type ApplicationLoader struct {
	// contains filtered or unexported fields
}

ApplicationLoader loads application packages from the filesystem. It validates package structure, loads definitions, values, and hooks.

func NewApplicationLoader

func NewApplicationLoader(appsDir string, logger *log.Logger) *ApplicationLoader

NewApplicationLoader creates a new ApplicationLoader for the specified directory. The appsDir should contain package directories organized as: <package>/<version>/

func (*ApplicationLoader) Load

Load loads an application package from the filesystem based on the instance specification. It performs the following steps:

  1. Validates package and version directories exist
  2. Loads package definition (package.yaml) - currently not used
  3. Loads values (static values.yaml and OpenAPI schemas)
  4. Discovers and loads hooks (shell and batch)
  5. Creates and returns an Application instance

Returns ErrPackageNotFound if package directory doesn't exist. Returns ErrVersionNotFound if version directory doesn't exist.

Jump to

Keyboard shortcuts

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