application

package
v0.16.1 Latest Latest
Warning

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

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

Documentation

Overview

Package application orchestrates the embedded-native-component measurement: read the module's verified zip through the blob port, decide which files the Go build compiles as native code, hand them to the domain for identification, and persist the record.

It contains no archive format knowledge beyond the shared ziparchive adapter, no Go parsing (that is the GoImportReader port), and no C parsing at all.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoNativeSurvey = errors.New("this native store cannot list its records")

ErrNoNativeSurvey is returned when the store this build was wired with cannot survey its own records. It is a different answer from "the store holds none", which is why it is an error and not an empty list.

Functions

This section is empty.

Types

type Config

type Config struct {
	Facts     fetchports.FactStore
	Blobs     fetchports.BlobStore
	Native    ports.NativeStore
	Source    ports.GoSourceReader
	Audit     ports.AuditSink
	Clock     fetchports.Clock
	Stopwatch fetchports.Stopwatch
	Logger    *slog.Logger
}

Config wires the ExtractNativeUseCase dependencies.

type ExtractNativeUseCase

type ExtractNativeUseCase struct {
	// contains filtered or unexported fields
}

ExtractNativeUseCase measures one module artefact for the native components it compiles into a binary.

func NewExtractNativeUseCase

func NewExtractNativeUseCase(cfg Config) *ExtractNativeUseCase

NewExtractNativeUseCase constructs the use case.

func (*ExtractNativeUseCase) Execute

func (uc *ExtractNativeUseCase) Execute(ctx context.Context, req ExtractRequest) (_ ExtractResult, retErr error)

Execute measures coord's artefact and persists the record.

The bytes come from the verified module zip the fetch ledger already holds, so the record inherits that artefact's verification status and needs no separate trust story. Nothing is built and no C toolchain is invoked.

type ExtractRequest

type ExtractRequest struct {
	Coordinate coordinate.ModuleCoordinate
	// Force re-measures even when a record for this generation is held.
	Force bool
}

ExtractRequest is the input to Execute.

type ExtractResult

type ExtractResult struct {
	Record    domain.Record
	FromCache bool
}

ExtractResult is the output of Execute.

type QueryNativeUseCase

type QueryNativeUseCase struct {
	// contains filtered or unexported fields
}

QueryNativeUseCase is read-only access to stored native-component records.

func NewQueryNativeUseCase

func NewQueryNativeUseCase(store ports.NativeStore) *QueryNativeUseCase

NewQueryNativeUseCase constructs the query use case.

func (*QueryNativeUseCase) Get

Get returns the stored record for a coordinate. found is false (with no error) when the module has not been examined at this generation — callers must surface that as "not examined", never as "no native component".

func (*QueryNativeUseCase) List

List returns summaries of the stored native records matching the filter.

It is the read that answers "which modules ship or link native code" without asking about each module in turn. The generation restriction lives in the filter and defaults to the generation this build serves; see ports.NativeFilter.

Jump to

Keyboard shortcuts

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