How goss-org/goss works
Goss is a YAML-based server-configuration validator. Users can generate resource checks from the current machine, edit or template the resulting Goss files, then validate them once or with retries, or expose validation as a health endpoint. The core stages are CLI dispatch, configuration/resource loading, resource validation against system probes, and formatted results; service checks illustrate the resource-to-system boundary. README documents render, templates, add/autoadd, retry, and serving. Some orchestration links are based on documented behavior because those source excerpts were not supplied.
Main entry points: goss.go Goss CLI · validate.go Validate command · goss_config.go Goss configuration · system.go System abstraction
Components 18
CLI and workflows
- Goss CLI
cmd/goss/goss.go - Add resources
add.go - Validate command
validate.go - Health server
serve.go
Goss files
- Goss configuration
goss_config.go - Template rendering
template.go - Configuration store
store.go
Validation engine
- Resource collection
resource/resource_list.go - Service checks
resource/service.go - Matchers
matchers/matchers.go
System probes
- System abstraction
system/system.go - Service probes
system/service_systemd.go - Command runner
util/command.go
Results and serving
- Output formats
outputs/outputs.go - JSON output
outputs/json.go - Validation retry
resource/retry.go
Other components
- Operator
- Health endpoint client
Connections 21
- Operator → Goss CLI: invokes
- Goss CLI → Add resources: dispatches add
- Goss CLI → Validate command: dispatches validate
- Goss CLI → Health server: dispatches serve
- Goss CLI → Template rendering: dispatches render
- Add resources → System abstraction: detects resources
- Add resources → Goss configuration: writes checks
- Validate command → Goss configuration: loads checks
- Template rendering → Goss configuration: renders imports
- Goss configuration → Configuration store: loads configuration
- Configuration store → Resource collection: builds resources
- Resource collection → System abstraction: creates probes
- Service checks → System abstraction: requests service
- Service checks → Matchers: checks values
- System abstraction → Service probes: selects implementation
- Service probes → Command runner: runs commands
- Validate command → Validation retry: retries checks
- Validate command → Output formats: formats results
- Health server → Output formats: formats response
- Health endpoint client → Health server: requests health
- Output formats → JSON output: selects format