Documentation
¶
Index ¶
- func LoadConfig() (*internal.Config, error)
- func Names() []string
- func PrintChecks(w io.Writer, results []Result)
- func PrintResults(w io.Writer, results []Result) int
- func WriteJSONChecks(w io.Writer, results []Result) error
- func WriteJSONResults(w io.Writer, results []Result) int
- type Check
- type Field
- type Result
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig loads configuration without running struct validation.
internal.NewConfig would reject a partial config before any check could run, which is the opposite of what preflight is for: each check validates only the fields it needs and reports them by name.
func PrintChecks ¶
PrintChecks renders every check, its skip state, and the config it reads. Pair it with Describe to list checks without touching the network.
func PrintResults ¶
PrintResults renders the results table and returns the process exit code. A skipped check is not a failure.
func WriteJSONChecks ¶
WriteJSONChecks emits the check catalogue as JSON. No summary: nothing ran.
Types ¶
type Check ¶
type Check struct {
Name string
Description string
// Skip reports why the check does not apply to this config, e.g. a
// cloud_provider or feature flag that turns the dependency off.
Skip func(cfg *internal.Config) (string, bool)
// Fields is a func rather than a static list so required-ness can depend on
// other config: db_password is only required when db_use_iam is off.
Fields func(cfg *internal.Config) []Field
Probe func(ctx context.Context, cfg *internal.Config) (string, error)
}
Check declares an external dependency, the config it reads, and how to probe it.
type Field ¶
Field is one config value a check depends on. Value is pre-rendered by the check so typed fields (bool, time.Duration) format themselves.
type Result ¶
func Describe ¶
Describe evaluates skip state and field values for the named checks without probing anything, backing `preflight --list`.