Documentation
¶
Overview ¶
Package config provides configuration management for the kat application.
It wraps other package configuration to provide a single API for loading, validating, and writing configuration files in YAML format.
Additionally, it implements JSON schema generation and validation for the configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ValidAPIVersions = []string{ "kat.jacobcolvin.com/v1beta1", } ValidKinds = []string{ "Configuration", } )
Functions ¶
func ReadConfig ¶
func ValidateWithSchema ¶ added in v0.15.0
ValidateWithSchema validates the given YAML data against the embedded JSON schema.
func WriteDefaultConfig ¶
WriteDefaultConfig writes the embedded default config.yaml and jsonschema to the specified path.
Types ¶
type Config ¶
type Config struct {
Command *command.Config `json:",inline"`
UI *ui.Config `json:",inline"`
// APIVersion specifies the API version for this configuration.
APIVersion string `json:"apiVersion" jsonschema:"title=API Version"`
// Kind defines the type of configuration.
Kind string `json:"kind" jsonschema:"title=Kind"`
}
func LoadConfig ¶
func (*Config) EnsureDefaults ¶
func (c *Config) EnsureDefaults()
func (Config) JSONSchemaExtend ¶ added in v0.15.0
func (c Config) JSONSchemaExtend(jss *jsonschema.Schema)
func (*Config) MarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.