First implementation of an atom feed
This commit is contained in:
19
commonAttributes.go
Normal file
19
commonAttributes.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package atomfeed
|
||||
|
||||
import "fmt"
|
||||
|
||||
type CommonAttributes struct {
|
||||
Base URI `xml:"base,attr,omitempty"`
|
||||
Lang LanguageTag `xml:"lang,attr,omitempty"`
|
||||
UndefinedAttributes []*ExtensionAttribute `xml:",any"`
|
||||
}
|
||||
|
||||
func (c *CommonAttributes) Check() error {
|
||||
for i, e := range c.UndefinedAttributes {
|
||||
if err := e.Check(); err != nil {
|
||||
return fmt.Errorf("extension attribute %v of common attributes: %v", i, err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user