Documentation ¶
Overview ¶
package opml provides functionalities for parsing and writing OPML files.
It follows the OPML 2.0 specifications [1], but keeps only tags relevant to processing subscription lists. Elements relating to display settings, such as expansionState or vertScrollState, are omitted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyPayload = errors.New("byte payload is empty") ErrEmptyDocument = errors.New("OPML document is empty") )
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct {
Outlines []*Outline `xml:"outline"`
}
Body is the <body> element of an OPML file.
type Categories ¶
type Categories []string
func (*Categories) MarshalXMLAttr ¶
func (*Categories) UnmarshalXMLAttr ¶
func (c *Categories) UnmarshalXMLAttr(attr xml.Attr) error
type Doc ¶
type Doc struct { XMLName xml.Name `xml:"opml"` Version string `xml:"version,attr"` Head Head `xml:"head"` Body Body `xml:"body"` }
Doc represents the minimal contents of an OPML file required to for storing a subscription list.
func Parse ¶
Parse parses the given raw OPML document into an OPML struct. Only version 2.0 is supported.
func (*Doc) AddOutline ¶
type Outline ¶
type Outline struct { Text string `xml:"text,attr"` Type string `xml:"type,attr"` XMLURL string `xml:"xmlUrl,attr"` Categories Categories `xml:"category,attr"` Description *string `xml:"description,attr"` HTMLURL *string `xml:"htmlUrl,attr"` IsStarred *bool `xml:"https://github.com/bow/neon isStarred,attr,omitempty"` }
Outline is a single outline item in the OPML body. It represents a single subscription / feed. Nesting is not supported.
Click to show internal directories.
Click to hide internal directories.