First implementation of an atom feed

This commit is contained in:
2024-10-13 17:19:40 +02:00
parent 520c2de196
commit 92c794d070
23 changed files with 805 additions and 0 deletions

19
inlineTextContent.go Normal file
View File

@@ -0,0 +1,19 @@
package atomfeed
import "errors"
type InlineTextContent struct {
*CommonAttributes
Type string `xml:"type,attr,omitempty"` // Must be text or html
Texts []string `xml:"texts,omitempty"`
}
func (i *InlineTextContent) IsContent() bool { return true }
func (i *InlineTextContent) Check() error {
if i.Type != "" && i.Type != "text" && i.Type != "html" {
return errors.New("type attribute of inline text content must be text or html if not omitted")
}
return nil
}