mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Merge pull request #200 from csaf-poc/metadata-validation
Add forgotten validation for metadata
This commit is contained in:
commit
3a3ef7a961
1 changed files with 18 additions and 0 deletions
|
|
@ -318,6 +318,24 @@ func (a *Aggregator) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UnmarshalText implements the encoding.TextUnmarshaller interface.
|
||||||
|
func (mdv *MetadataVersion) UnmarshalText(data []byte) error {
|
||||||
|
s, err := metadataVersionPattern(data)
|
||||||
|
if err == nil {
|
||||||
|
*mdv = MetadataVersion(s)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalText implements the encoding.TextUnmarshaller interface.
|
||||||
|
func (mdr *MetadataRole) UnmarshalText(data []byte) error {
|
||||||
|
s, err := metadataRolePattern(data)
|
||||||
|
if err == nil {
|
||||||
|
*mdr = MetadataRole(s)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// UnmarshalText implements the encoding.TextUnmarshaller interface.
|
// UnmarshalText implements the encoding.TextUnmarshaller interface.
|
||||||
func (ac *AggregatorCategory) UnmarshalText(data []byte) error {
|
func (ac *AggregatorCategory) UnmarshalText(data []byte) error {
|
||||||
s, err := aggregatorCategoryPattern(data)
|
s, err := aggregatorCategoryPattern(data)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue