Documentation
¶
Overview ¶
Package composition declares the build-time composition of Bomly's embedded (native) components as execution-neutral sdk.Module entries. The registry consumes Entries() and registers each module through Registry.RegisterModule instead of bespoke per-component wiring. Build-tag variants (composition_full.go / composition_lite.go) decide which implementation backs tag-sensitive entries such as grype.
Index ¶
Constants ¶
const ( // ImplementationNative marks a component compiled into the host binary. ImplementationNative = "native" // ImplementationPlugin marks a component backed by an external managed // plugin process. ImplementationPlugin = "plugin" )
Implementation values accepted by Entry.Implementation.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Logger *zap.Logger
HTTPClientProvider *httpkit.ClientProvider
OsvAPIBase string
OsvCacheDir string
OsvCacheTTL string
KEVCacheDir string
KEVCacheTTL string
ScorecardAPIBase string
ScorecardCacheDir string
ScorecardCacheTTL string
}
Deps carries the host-resolved inputs module constructors need. It mirrors what the registry's bespoke matcher/analyzer wiring used to pass: configuration overrides, the shared logger, and the shared HTTP client provider.
type Entry ¶
type Entry struct {
// Name is the component's descriptor name.
Name string
// Kind is the component's plugin kind.
Kind plugin.PluginKind
// Implementation is ImplementationNative or ImplementationPlugin.
Implementation string
// DefaultEnabled reports whether the component runs without explicit
// selection.
DefaultEnabled bool
// Module builds the execution-neutral module for this entry.
Module func(Deps) plugin.Module
}
Entry describes one composed component.
func Entries ¶
func Entries() []Entry
Entries returns the composed component entries for this build variant, in registration order.
func (Entry) Origin ¶
func (e Entry) Origin(execution plugin.ExecutionMode) (plugin.DetectorOrigin, error)
Origin maps the entry's implementation and the requested execution mode to the component origin the registry records. Native components must run embedded: a native entry combined with any non-embedded execution is a composition bug and is rejected.