atom/inlineTextContent.go

24 lines
601 B
Go

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) hasSRC() bool { return false }
func (i *InlineTextContent) getType() string { return i.Type }
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
}