Documentation
¶
Overview ¶
Package detect inspects a project directory and works out what it needs to run: language runtimes, backing services, and which third-party APIs it talks to. Everything is inferred from files that are already in the repository — Cauldron never requires its own config file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoProject = errors.New("no recognisable project manifest found")
ErrNoProject is returned when a directory contains nothing Cauldron can read.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind string
Kind classifies a detected requirement.
const ( // KindRuntime is a language runtime, e.g. PHP 8.5 or Node 24. KindRuntime Kind = "runtime" // KindService is a backing service Cauldron boots itself, e.g. PostgreSQL. KindService Kind = "service" // KindRecipe is a third-party API Cauldron emulates, e.g. Stripe. KindRecipe Kind = "recipe" )
type Project ¶
type Project struct {
Root string
Framework string
Requirements []Requirement
// Unmatched holds dependencies that look like third-party API clients but
// have no Recipe yet. Surfacing these is deliberate: silently falling back
// to the real network is how a test suite starts lying.
Unmatched []Requirement
}
Project is the result of inspecting a directory.
func (*Project) Of ¶
func (p *Project) Of(kind Kind) []Requirement
Of returns every requirement of a given kind.
type Requirement ¶
type Requirement struct {
Kind Kind
// Name is the canonical identifier: "php", "postgres", "stripe".
Name string
// Version is the resolved or requested version, when one is knowable.
Version string
// Source records which file produced this requirement, so `cauldron doctor`
// can explain itself rather than being a black box.
Source string
// Evidence is the specific token that triggered detection, e.g. the package
// name "stripe/stripe-php".
Evidence string
}
Requirement is a single thing the project needs.
Click to show internal directories.
Click to hide internal directories.