Documentation
¶
Overview ¶
Package schema provides a component validating the Agent configurations against their schemas
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component interface {
// ValidateConfig validates the settings of config against its schema (see model.Reader.GetSchemaID), records
// the violations for GetViolations and returns them.
//
// It's meant to be called by the configuration while it loads: once the configuration file and the environment
// variables are loaded, but before secrets are resolved and before the Agent changes any setting at runtime.
// Secrets are therefore still ENC[] placeholders, which are not validated.
ValidateConfig(config model.Reader) ([]*model.Violation, error)
// GetViolations returns the violations recorded by the last ValidateConfig for the schemaID.
GetViolations(schemaID model.SchemaID) []*model.Violation
// ValidateYAML validates raw YAML contents against the schema identified by schemaID.
ValidateYAML(data []byte, schemaID model.SchemaID) ([]*model.Violation, error)
}
Component validates configurations against the schemas embedded in the Agent.
Validating a configuration links the JSON schema library and the embedded schemas into the binary. Binaries that don't validate their configuration use the noop implementation to stay small.