opml

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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 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 ImportJob

type ImportJob struct {
	ID uint32
	// contains filtered or unexported fields
}

ImportJob is a job that import OPML

func (*ImportJob) Wait

func (job *ImportJob) Wait(timeout time.Duration) bool

Wait for job complete Returns true if the wait completed without timing out, false otherwise.

type ImportJobItemResult

type ImportJobItemResult struct {
	// contains filtered or unexported fields
}

ImportJobItemResult is the OPML outline import result

type Importer

type Importer struct {
	// contains filtered or unexported fields
}

Importer is used to trace OPML import jobs in background

func NewOPMLImporter

func NewOPMLImporter(db store.DB) *Importer

NewOPMLImporter creates new OPML importer

func (*Importer) Get

func (importer *Importer) Get(jobID uint) (chan string, error)

Get import job

func (*Importer) ImportOPML

func (importer *Importer) ImportOPML(opml *OPML) (*ImportJob, error)

ImportOPML imports OPML object into the DB

func (*Importer) ImportOPMLFile

func (importer *Importer) ImportOPMLFile(filename string) (*ImportJob, error)

ImportOPMLFile imports OPML file into the DB

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