builder

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package builder defines the Builder interface and supporting types for the wfctl build pipeline. Implementations live in plugins/builder-*.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(b Builder)

Register adds b to the registry, overwriting any prior registration with the same name.

func Reset

func Reset()

Reset clears all registrations. Intended for tests only.

Types

type Artifact

type Artifact struct {
	Name     string
	Kind     string // binary | image | bundle | other
	Paths    []string
	Metadata map[string]any
}

Artifact is a single file or image produced by a builder.

type Builder

type Builder interface {
	// Name returns the unique identifier used in ci.build.targets[].type.
	Name() string
	// Validate checks the Config without executing anything.
	Validate(cfg Config) error
	// Build executes the build and populates out with produced artifacts.
	Build(ctx context.Context, cfg Config, out *Outputs) error
	// SecurityLint inspects the config for supply-chain issues and returns
	// zero or more findings. It must not execute any build steps.
	SecurityLint(cfg Config) []Finding
}

Builder is the contract every build plugin must satisfy.

func Get

func Get(name string) (Builder, bool)

Get returns the Builder registered under name, or (nil, false) if not found.

func List

func List() []Builder

List returns all registered builders in an unspecified order.

type Config

type Config struct {
	TargetName string
	Path       string
	Fields     map[string]any
	Env        map[string]string
	Security   *SecurityConfig
}

Config carries all inputs a Builder needs to produce its artifacts.

type Finding

type Finding struct {
	Severity string // info | warn | critical
	Message  string
	File     string
	Line     int
}

Finding is a security or policy issue found by SecurityLint.

type Outputs

type Outputs struct {
	Artifacts []Artifact
}

Outputs accumulates the artifacts produced by a single Build call.

type SecurityConfig

type SecurityConfig struct {
	Hardened   bool
	SBOM       bool
	Provenance string
	NonRoot    bool
}

SecurityConfig mirrors the relevant subset of CIBuildSecurity so builders don't need to import the config package.

Jump to

Keyboard shortcuts

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