opml

package
v0.0.0-...-44d4e1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2022 License: MIT Imports: 4 Imported by: 3

Documentation

Overview

Package opml implements functions capable of parsing opml files containing a list of feed subscriptions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	Outline []Outline `xml:"outline"`
}
type Head struct {
	Title string `xml:"title"`
}

type Opml

type Opml struct {
	XMLName struct{} `xml:"opml"`
	Version string   `xml:"version,attr"`
	Head    Head     `xml:"head"`
	Body    Body     `xml:"body"`
}

func Load

func Load(path string) (doc Opml, err error)

Load parses the OPML file at the path.

func Read

func Read(r io.Reader) (doc Opml, err error)

Read parses an OPML document.

func (Opml) Encode

func (doc Opml) Encode(w io.Writer) error

Encode writes the OPML document out.

type Outline

type Outline struct {
	Type   string `xml:"type,attr,omitempty"`
	Text   string `xml:"text,attr,omitempty"`
	XMLURL string `xml:"xmlUrl,attr,omitempty"`

	// description is the top-level description element from the feed.
	Description string `xml:"description,attr,omitempty"`

	// htmlUrl is the top-level link element.
	HTMLURL string `xml:"htmlUrl,attr,omitempty"`

	// language is the value of the top-level language element.
	Language string `xml:"language,attr,omitempty"`

	// title is probably the same as text, it should not be omitted. title
	// contains the top-level title element from the feed.
	Title string `xml:"title,attr,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL