Documentation
¶
Overview ¶
Package opml provides all the required structures and functions for parsing OPML files, as defined by the specification of the OPML format:
[OPML 1.0] http://dev.opml.org/spec1.html [OPML 2.0] http://dev.opml.org/spec2.html
It is able to parse both, OPML 1.0 and OPML 2.0, files.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct {
Outlines []Outline `xml:"outline"`
}
Body is the parent structure of all outlines.
type Head ¶
type Head struct { Title string `xml:"title"` DateCreated string `xml:"dateCreated,omitempty"` DateModified string `xml:"dateModified,omitempty"` OwnerName string `xml:"ownerName,omitempty"` OwnerEmail string `xml:"ownerEmail,omitempty"` OwnerID string `xml:"ownerId,omitempty"` Docs string `xml:"docs,omitempty"` ExpansionState string `xml:"expansionState,omitempty"` VertScrollState string `xml:"vertScrollState,omitempty"` WindowTop string `xml:"windowTop,omitempty"` WindowBottom string `xml:"windowBottom,omitempty"` WindowLeft string `xml:"windowLeft,omitempty"` WindowRight string `xml:"windowRight,omitempty"` }
Head holds some meta information about the document.
type OPML ¶
type OPML struct { XMLName xml.Name `xml:"opml"` Version string `xml:"version,attr"` Head Head `xml:"head"` Body Body `xml:"body"` }
OPML is the root node of an OPML document. It only has a single required attribute: the version.
func NewOPMLFromFile ¶
NewOPMLFromFile creates a new OPML structure from a file.
Example ¶
package main import ( "fmt" "log" "github.com/gilliek/go-opml/opml" ) func main() { doc, err := opml.NewOPMLFromFile("path/to/file.xml") if err != nil { log.Fatal(err) } fmt.Println(doc) }
Output:
func NewOPMLFromURL ¶
NewOPMLFromURL creates a new OPML structure from an URL.
type Outline ¶
type Outline struct { Outlines []Outline `xml:"outline"` Text string `xml:"text,attr"` Type string `xml:"type,attr,omitempty"` IsComment string `xml:"isComment,attr,omitempty"` IsBreakpoint string `xml:"isBreakpoint,attr,omitempty"` Created string `xml:"created,attr,omitempty"` Category string `xml:"category,attr,omitempty"` XMLURL string `xml:"xmlUrl,attr,omitempty"` HTMLURL string `xml:"htmlUrl,attr,omitempty"` URL string `xml:"url,attr,omitempty"` Language string `xml:"language,attr,omitempty"` Title string `xml:"title,attr,omitempty"` Version string `xml:"version,attr,omitempty"` Description string `xml:"description,attr,omitempty"` }
Outline holds all information about an outline.
Click to show internal directories.
Click to hide internal directories.