Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotABool indicates a string value that cannot be converted to a bool ErrNotABool = errors.New("Not a valid boolean string") )
var ErrNotLicense = errors.New("Licenses must be a single string or an array of strings")
ErrNotLicense indicates that a Licenses is being read from invalid YAML or written when empty
Functions ¶
This section is empty.
Types ¶
type DefaultFalse ¶
DefaultFalse is a boolean which should omitted if false when marshaling
func (DefaultFalse) MarshalYAML ¶
func (df DefaultFalse) MarshalYAML() (out interface{}, err error)
MarshalYAML writes a DefaultFalse as "yes" if true and omits it if empty or invalid
func (*DefaultFalse) UnmarshalYAML ¶
func (df *DefaultFalse) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML converts a string to a DefaultFalse based on its value
type DefaultTrue ¶
DefaultTrue is a boolean which should omitted if true when marshaling
func (DefaultTrue) MarshalYAML ¶
func (dt DefaultTrue) MarshalYAML() (out interface{}, err error)
MarshalYAML writes a DefaultTrue as "no" if false and omits it if empty or invalid
func (*DefaultTrue) UnmarshalYAML ¶
func (dt *DefaultTrue) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML converts a string to a DefaultTrue based on its value
type Licenses ¶
type Licenses []yaml.Node
Licenses is allowed to contain one or more SPDX license identifiers, but may be a scalar or a list in YAML
func (Licenses) MarshalYAML ¶
MarshalYAML converts Licenses to a string (singular) or list (plural) when writing YAML