inspection

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package inspection collects feature-owned declarations and configuration provenance. It never resolves services, starts kernels or reads setting values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(name cli.Name, collect func(context.Context) (Report, error)) (cli.Declaration, error)

Command supplies an explicit metadata-only CLI declaration. Parse and run this declaration before application Build/Run when inspecting without service startup. The pure collector can capture the final command registry, avoiding a second declaration list. It must not construct or start services.

func Write

func Write(ctx context.Context, output io.Writer, report Report, arguments Arguments) error

Write selects an existing owned metadata section. Text uses indented JSON so typed policy details remain visible; JSON uses compact machine-readable JSON. Configuration sections contain provenance names and secret markers, no values.

Types

type Arguments

type Arguments struct {
	Section Section
	Format  Format
}

Arguments selects the inspection section and output format.

func (Arguments) Validate

func (a Arguments) Validate() error

Validate validates the requested section and output format, returning usage errors for unsupported values.

type Format

type Format string

Format selects the inspection output encoding.

const (
	JSON Format = "json"
	Text Format = "text"
)

type Report

type Report struct {
	Assembly      foundation.Inspection   `json:"assembly"`
	Routes        []foundryhttp.RouteInfo `json:"routes"`
	Jobs          []jobs.Description      `json:"jobs"`
	Schedules     []schedule.Description  `json:"schedules"`
	Commands      []cli.Description       `json:"commands"`
	Configuration []config.Entry          `json:"configuration"`
	Contracts     *manifest.Document      `json:"contracts,omitempty"`
	Extensions    []slots.Description     `json:"extensions"`
}

Report contains inspection data for application assembly and registered declarations.

func Collect

func Collect(ctx context.Context, sources Sources) (Report, error)

Collect returns owned snapshots using each feature's existing metadata API. It performs no database, queue, lease, HTTP or credential issuance operation.

func (Report) Format

func (Report) Format(state fmt.State, _ rune)

Format writes a fixed label without exposing application declarations.

type Section

type Section string

Section selects an inspection report section.

const (
	All           Section = "all"
	Routes        Section = "routes"
	Jobs          Section = "jobs"
	Schedules     Section = "schedules"
	Plugins       Section = "plugins"
	Commands      Section = "commands"
	Configuration Section = "configuration"
	Contracts     Section = "contracts"
	Extensions    Section = "extensions"
)

type Sources

type Sources struct {
	Builder       *foundation.Builder
	HTTP          *foundryhttp.Router
	Jobs          *jobs.Registry
	Dispatcher    *jobs.Dispatcher
	Schedules     *schedule.Registry
	Commands      *cli.Registry
	Contracts     *manifest.Manifest
	Configuration []config.Report
	// Models lists generated model extension declarations, such as a model
	// package's FoundryExtensions().
	Models []slots.Declaration
}

Sources borrows actual assembled registries or pure declarations. Builder inspection runs repeatable Register callbacks, never constructors or Boot. Supply either a job registry or its already assembled dispatcher, not both.

Jump to

Keyboard shortcuts

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