First implementation of an atom feed
This commit is contained in:
19
inlineTextContent.go
Normal file
19
inlineTextContent.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user