Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ComponentV2_0_0 is a semver representation of version 2.0.0 of component.yaml. ComponentV2_0_0 = semver.MustParse("2.0.0") // ComponentV3_0_0 is a semver representation of version 3.0.0 of component.yaml. ComponentV3_0_0 = semver.MustParse("3.0.0") // ComponentV3_1_0 is a semver representation of version 3.1.0 of component.yaml. ComponentV3_1_0 = semver.MustParse("3.1.0") )
Functions ¶
Types ¶
type Base ¶
Base is the bare minimum that every component YAML will have and is used to find the schema version. Complete implementations of component do not need to embed this struct or put it as a field in the component. When this struct is used in the ParseComponent function, it will transfer the version from this struct to the final component struct via SetVersion.
func (*Base) UnmarshalYAML ¶
UnmarshalYAML is a overridden implementation of YAML parsing the component.yaml This method is similar to the one found here: http://choly.ca/post/go-json-marshalling/ This is necessary because we want to have backwards compatibility with parsing the old types of version 2.0 (type =float). To compensate for that, we have to hand roll our own UnmarshalYAML that can decide what to do for parsing the older version of type float and converting it into semver. In addition, we will use this logic to parse strings into semver.
type BaseComponentParseError ¶
type BaseComponentParseError struct {
// contains filtered or unexported fields
}
BaseComponentParseError is the type of error that will be returned if the parsing failed for ONLY the `Base` struct.
func NewComponentParseError ¶
func NewComponentParseError(message string) BaseComponentParseError
NewComponentParseError is a constructor for creating errors of type BaseComponentParseError
func (BaseComponentParseError) Error ¶
func (b BaseComponentParseError) Error() string