Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ErrMalformedBaseYamlPrefix is just the prefix to the error message for when the program is unable to parse // data into the base yaml struct. ErrMalformedBaseYamlPrefix = "Unable to parse yaml data" )
Variables ¶
View Source
var ( // SchemaV1_0_0 is the semantic versioning representation in object form for version 1.0.0 SchemaV1_0_0 = semver.Version{Major: 1, Minor: 0, Patch: 0, Pre: nil, Build: nil} )
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { // SchemaVersion contains the schema version. SchemaVersion string `yaml:"schema_version"` }
Base is the common struct that all schemas must have.
func (Base) GetSchemaVersion ¶
GetSchemaVersion is a simple getter function of the schema version.
type SchemaParser ¶
type SchemaParser interface {
Parse(data []byte) (common.OpenControl, error)
}
SchemaParser is a generic interface that knows how parse different schema_versions.
type YAMLParser ¶
type YAMLParser struct{}
YAMLParser is the concrete implementation of parsing different schema versions in YAML format.
func (YAMLParser) Parse ¶
func (parser YAMLParser) Parse(data []byte) (common.OpenControl, error)
Parse will try to parse the data and determine which specific version of schema to further parse.
Click to show internal directories.
Click to hide internal directories.