specloader

package
v3.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MinSpecVersion = 1
	MaxSpecVersion = 1
)

Variables

This section is empty.

Functions

func HomeSpecDir

func HomeSpecDir() string

HomeSpecDir returns the directory that holds dynamically-installed plugin specs: ~/.harness/spec (respecting HARNESS_CLI_HOME).

func LoadHomeSpecs

func LoadHomeSpecs(reg *registry.Registry, cfg *config.Config, harnessDomainMatch bool) error

LoadHomeSpecs loads plugin spec files from ~/.harness/spec (the sole source of truth for dynamically-installed plugins). A missing directory is not an error. Home specs whose module name collides with an already-registered (embedded) module are skipped with a stderr warning — embedded always wins.

func LoadSpec

func LoadSpec(reg *registry.Registry, name string, isHarnessUser bool) ([]byte, error)

Returns the raw bytes it read so a plugin main() can also hand them to rootcmd.SetupAndExecutePluginRootCmd for its own --spec dump, without a second read of the same file.

func LoadSpecBytes

func LoadSpecBytes(reg *registry.Registry, name string, data []byte, isHarnessUser bool) ([]byte, error)

LoadSpecBytes is LoadSpec's counterpart for a plugin whose spec file lives in its own repo rather than core's pkg/spec.

func LoadSpecs

func LoadSpecs(reg *registry.Registry) error

LoadSpecs loads all embedded builtin spec files into reg, then any dynamically installed plugin specs from ~/.harness/spec. Embedded specs always win: a home spec whose module name is already registered is skipped with a warning.

Embedded specs for plugin modules (spec.PluginFiles(), e.g. har) are not registered here — they are plugins, not builtins, and reach the host only through the home spec dir (with a binary_path to dispatch to). This lets a dev-installed plugin spec in ~/.harness/spec drive the real dynamic path instead of being masked by an embedded copy. Only their noun ownership is recorded (best-effort, for "plugin not installed" error messages).

func ReadSpecFile

func ReadSpecFile(moduleName string) ([]byte, error)

ReadSpecFile returns the raw bytes of the spec file for a module (e.g. "har" → har.spec.yaml).

Types

This section is empty.

Jump to

Keyboard shortcuts

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