composition

package
v0.23.0 Latest Latest
Warning

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

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

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

View Source
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 *sdk.HTTPClientProvider

	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 sdk.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) sdk.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 sdk.ExecutionMode) (sdk.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.

Jump to

Keyboard shortcuts

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