module

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: GPL-3.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, mod *Module, targetDir string, opts RunOptions) error

Execute runs all operations in a module sequentially.

func ResolveSource

func ResolveSource(source, parentDir string, logger *slog.Logger) (dir string, cleanup func(), err error)

ResolveSource resolves a module source to a local directory. Sources starting with "." or "/" are treated as local paths (cleanup is nil). Other sources are treated as git URLs and cloned to a temp directory. The "//" separator in git URLs denotes a subdirectory within the repo. Callers must call cleanup (if non-nil) when the directory is no longer needed.

Types

type Module

type Module struct {
	// Dir is the directory containing the module's loom.yaml.
	Dir string
	// Config is the parsed loom.yaml.
	Config *config.LoomFile
	// Params are the resolved parameters for this module.
	Params map[string]string
	// Logger is the structured logger.
	Logger *slog.Logger
}

Module represents a loaded and resolved loom module.

func Load

func Load(dir string, providedParams map[string]string, logger *slog.Logger) (*Module, error)

Load loads a module from a directory, merging provided params with defaults.

func (*Module) NewExecutionContext

func (m *Module) NewExecutionContext(targetDir string, opts RunOptions) *action.ExecutionContext

NewExecutionContext creates an ExecutionContext for this module.

type RunOptions added in v0.1.2

type RunOptions struct {
	DryRun   bool
	LocalRun bool
	ShowDiff bool
	// DiffWriter is the destination for diff output. Defaults to os.Stdout.
	DiffWriter io.Writer
	// TargetPath is the base directory for --local-run mode.
	// Each module with a target spec clones into a numbered subdirectory.
	TargetPath string
	// GitAuthor is the default git author name for commitPush operations
	// when not specified in loom.yaml.
	GitAuthor string
	// GitEmail is the default git author email for commitPush operations
	// when not specified in loom.yaml.
	GitEmail string
	// contains filtered or unexported fields
}

RunOptions holds runtime flags for module execution.

func (*RunOptions) NextLocalDir added in v0.1.3

func (o *RunOptions) NextLocalDir(name string) string

NextLocalDir returns the next numbered subdirectory under TargetPath for a module with the given name, e.g. "00-parent-module".

Jump to

Keyboard shortcuts

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