config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: GPL-3.0 Imports: 4 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

View Source
const (
	ExpectedAPIVersion = "loom.rickliujh.github.io/v1beta1"
	ExpectedKind       = "Loom"
)

Variables

This section is empty.

Functions

func Validate

func Validate(lf *LoomFile) error

Validate checks that a LoomFile has required fields and valid structure.

Types

type CommitPush

type CommitPush struct {
	Message string `yaml:"message"`
	Author  string `yaml:"author,omitempty"`
	Email   string `yaml:"email,omitempty"`
}

type LoomFile

type LoomFile struct {
	APIVersion string   `yaml:"apiVersion"`
	Kind       string   `yaml:"kind"`
	Metadata   Metadata `yaml:"metadata"`
	Spec       Spec     `yaml:"spec"`
}

LoomFile represents the top-level loom.yaml structure.

func Load

func Load(moduleDir string) (*LoomFile, error)

Load reads and parses a loom.yaml file from the given module directory.

type Metadata

type Metadata struct {
	Name string `yaml:"name"`
}

type ModuleRef

type ModuleRef struct {
	Name   string            `yaml:"name"`
	Source string            `yaml:"source"`
	Params map[string]string `yaml:"params,omitempty"`
}

type NewFiles

type NewFiles struct {
	Source string `yaml:"source"`
	Dest   string `yaml:"dest,omitempty"`
}

type Operation

type Operation struct {
	Name       string      `yaml:"name"`
	NewFiles   *NewFiles   `yaml:"newFiles,omitempty"`
	Patch      *Patch      `yaml:"patch,omitempty"`
	Shell      *Shell      `yaml:"shell,omitempty"`
	CommitPush *CommitPush `yaml:"commitPush,omitempty"`
	PR         *PR         `yaml:"pr,omitempty"`
}

type PR

type PR struct {
	Provider   string   `yaml:"provider"`
	Title      string   `yaml:"title"`
	Body       string   `yaml:"body,omitempty"`
	BaseBranch string   `yaml:"baseBranch,omitempty"`
	Labels     []string `yaml:"labels,omitempty"`
	TokenEnv   string   `yaml:"tokenEnv,omitempty"`
}

type ParamDef

type ParamDef struct {
	Name     string `yaml:"name"`
	Required bool   `yaml:"required,omitempty"`
	Default  string `yaml:"default,omitempty"`
	Dynamic  string `yaml:"dynamic,omitempty"` // Shell command whose stdout becomes the param value.
}

type Patch

type Patch struct {
	Engine string `yaml:"engine,omitempty"` // "smp" (default, strategic merge patch) or "json6902"
	Path   string `yaml:"path"`
	Target string `yaml:"target"`
}

type Shell

type Shell struct {
	Command string `yaml:"command"`
	Timeout string `yaml:"timeout,omitempty"`
}

type Spec

type Spec struct {
	Params     []ParamDef  `yaml:"params,omitempty"`
	Target     *TargetSpec `yaml:"target,omitempty"`
	Modules    []ModuleRef `yaml:"modules,omitempty"`
	Operations []Operation `yaml:"operations,omitempty"`
}

type TargetSpec

type TargetSpec struct {
	URL           string `yaml:"url"`
	Branch        string `yaml:"branch,omitempty"`
	FeatureBranch string `yaml:"featureBranch,omitempty"`
}

Jump to

Keyboard shortcuts

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