opml

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportOPMLToDB

func ImportOPMLToDB(opml *OPML, db store.DB) error

ImportOPMLToDB imports OPML object into the database.

Types

type Body

type Body struct {
	Outlines []Outline `xml:"outline"`
}

Body is the body node of an OPML document.

type Head struct {
	Title        string `xml:"title"`
	DateCreated  string `xml:"dateCreated,omitempty"`
	DateModified string `xml:"dateModified,omitempty"`
}

Head is the header node of an OPML 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.

func NewOPML

func NewOPML(title string) *OPML

NewOPML creates new empty OPML object.

func NewOPMLFromBytes

func NewOPMLFromBytes(b []byte) (*OPML, error)

NewOPMLFromBytes creates a new OPML object from a byte array.

func NewOPMLFromFile

func NewOPMLFromFile(filename string) (*OPML, error)

NewOPMLFromFile creates a new OPML object from a file.

func (*OPML) XML

func (doc *OPML) XML() (string, error)

XML returns the OPML document as a XML string.

type Outline

type Outline struct {
	Outlines    []Outline `xml:"outline"`
	Text        string    `xml:"text,attr"`
	Type        string    `xml:"type,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"`
	Title       string    `xml:"title,attr,omitempty"`
	Description string    `xml:"description,attr,omitempty"`
}

Outline contains details about the subscription.

Jump to

Keyboard shortcuts

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