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: 8 Imported by: 0

Documentation

Overview

Package application orchestrates godebug detection: load via ports, delegate classification to the domain taxonomy, evaluate governance via the config policy, persist the record and emit audit facts. It contains no source parsing, no risk rules and no I/O of its own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Scanner   ports.GoDebugScanner
	Store     ports.GoDebugStore
	Audit     ports.AuditSink
	Clock     fetchports.Clock
	Stopwatch fetchports.Stopwatch
	Logger    *slog.Logger
}

Config wires the ExtractGoDebugUseCase dependencies.

type ExtractGoDebugUseCase

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

ExtractGoDebugUseCase detects, classifies, policy-evaluates and persists the GODEBUG / //go:debug settings of a project.

func NewExtractGoDebugUseCase

func NewExtractGoDebugUseCase(cfg Config) *ExtractGoDebugUseCase

NewExtractGoDebugUseCase constructs the use case.

func (*ExtractGoDebugUseCase) Extract

func (uc *ExtractGoDebugUseCase) Extract(
	ctx context.Context, goModPath string, policy configdomain.GoDebugPolicy, configHash string,
) (domain.Record, error)

Extract scans goModPath, classifies every setting against the versioned taxonomy, evaluates it against policy, persists the record, and emits one audit event per setting. The returned record's settings carry their tier and policy verdict.

type QueryGoDebugUseCase

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

QueryGoDebugUseCase is read-only access to stored godebug records, used by the `godebug` command and the `inspect` aggregate.

func NewQueryGoDebugUseCase

func NewQueryGoDebugUseCase(store ports.GoDebugStore) *QueryGoDebugUseCase

NewQueryGoDebugUseCase constructs the query use case.

func (*QueryGoDebugUseCase) Get

func (uc *QueryGoDebugUseCase) Get(ctx context.Context, projectModulePath string) (domain.Record, bool, error)

Get returns the stored record for a project module path. found is false (no error) when the project has not been scanned — callers must surface that as "not analysed", never as "no settings".

Jump to

Keyboard shortcuts

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