Documentation
¶
Overview ¶
Package generate is responsible for generating GoLang representations of the redhat-best-practices-for-k8s claim defined by `claim-schema.json`. A modified version of `https://github.com/sebrandon1/generate` is utilized to emit GoLang structs and their corresponding `MarshallJSON` and `UnmarshallJSON` interface implementations. A modified version was utilized since the original version (`https://github.com/sebrandon1/generate`) blindly remaps JSON "object" types to GoLang structs. In this case, we have no struct definition for some facets of our claim, such as "LshwOutput" and "JunitResults". This is due to the fact that others define those JSON structures, and we are not in the business of redefinition. This is a rare case in which we want to allow GoLang to represent arbitrary JSON data. If deeper meaning is needed for such properties at a later point, GoLang provides a reflection interface which can aid in providing more granular type information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyOverrideConfiguration ¶
func ApplyOverrideConfiguration(g *generate.Generator, config *OverrideConfig) error
ApplyOverrideConfiguration applies all override configurations specified.
Types ¶
type OverrideConfig ¶
type OverrideConfig struct { // Properties provides a means of specifying override settings for a particular property. Properties []OverrideSettings `json:"properties,omitempty" yaml:"properties,omitempty"` }
OverrideConfig provides a means of specifying override values for code generation.
func GetOverrideConfig ¶
func GetOverrideConfig(overrideConfigFile string) (*OverrideConfig, error)
GetOverrideConfig extracts the override settings for code generation.
type OverrideSettings ¶
type OverrideSettings struct { // Parent is the JSON Schema parent for a given property. Path []string `json:"path" yaml:"path"` // OverrideType is the type the code generator should emit for a given property. Normally, this is `map[string]interface{}`. OverrideType string `json:"overrideType" yaml:"overrideType"` }
OverrideSettings contains the override values for a particular property.