Documentation
¶
Overview ¶
Package installresolver is Pig's product-neutral seam for contributed package-source behavior. Optional catalog/product packages register through it so generic Pig packages (for example the piglet schema package) and the plugin-update path do not import a concrete product package.
The registry carries product-neutral piglet-origin, materialization, and package-reinstall callbacks.
pig additive (D18): product-neutral install and Piglet source resolver seams.
Index ¶
- func Install(cwd, source, scope string, stdout, stderr io.Writer) error
- func Materialize(cwd, source, scope string, options MaterializeOptions, ...) (string, error)
- func RegisterPigletSourceResolver(scheme string, resolver PigletSourceResolver) error
- func RegisterSourceScheme(scheme string) error
- func ResolvePigletSource(cwd, source string) (string, error)
- func SetInstaller(installer Installer)
- func SetMaterializer(materializer Materializer)
- func SupportsSourceScheme(scheme string) bool
- type Installer
- type MaterializeOptions
- type Materializer
- type PigletSourceResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Materialize ¶
func Materialize(cwd, source, scope string, options MaterializeOptions, stdout, stderr io.Writer) (string, error)
Materialize resolves one source without mutating Package settings.
func RegisterPigletSourceResolver ¶
func RegisterPigletSourceResolver(scheme string, resolver PigletSourceResolver) error
RegisterPigletSourceResolver registers one exact typed source scheme.
func RegisterSourceScheme ¶
RegisterSourceScheme claims one explicit package/piglet source scheme. Duplicate claims are rejected so a source never depends on import order.
func ResolvePigletSource ¶
ResolvePigletSource dispatches one typed source to its exact scheme owner.
func SetInstaller ¶
func SetInstaller(installer Installer)
SetInstaller supplies the core package installer callback used when a contributed command needs to reinstall one of its recorded sources.
func SetMaterializer ¶
func SetMaterializer(materializer Materializer)
SetMaterializer supplies the side-effect-free package source materializer.
func SupportsSourceScheme ¶
SupportsSourceScheme reports whether a contributed resolver claimed scheme.
Types ¶
type Installer ¶
Installer reinstalls one recorded package source through the core install pipeline.
type MaterializeOptions ¶
type MaterializeOptions struct {
// AllowInstallScripts lets the package manager run the lifecycle scripts of
// an npm or Git Package and of its dependencies. The zero value installs
// with scripts disabled.
//
// pig additive (D194): Piglet resolution installs Packages without running lifecycle scripts unless the user opts in.
AllowInstallScripts bool
}
MaterializeOptions selects how one source is installed.
type Materializer ¶
type Materializer func(cwd, source, scope string, options MaterializeOptions, stdout, stderr io.Writer) (root string, err error)
Materializer resolves one source to a local root without adding it to Package settings or activating any resources. Piglets use this path for dependencies.
type PigletSourceResolver ¶
PigletSourceResolver acquires one typed Piglet source. The resolver is registered by source scheme and receives the opaque locator after the colon.