README

go-opml GoDoc builds.sr.ht status

An implementation of the OPML message format for Go.

Contributing

Send patches to ~chrisppy/beagles-devel@lists.sr.ht

License

MIT

Expand ▾ Collapse ▴

Documentation

Overview

    Package opml is an implementation of the OPML message format for Go.

    https://git.sr.ht/~chrisppy/go-opml

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Body

    type Body struct {
    	XMLName  xml.Name   `xml:"body"`
    	Outlines []*Outline `xml:"outline"`
    }

      Body Elements

      type Head struct {
      	XMLName         xml.Name `xml:"head"`
      	Title           string   `xml:"title,omitempty"`
      	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 int      `xml:"vertScrollState,omitempty"`
      	WindowTop       int      `xml:"windowTop,omitempty"`
      	WindowLeft      int      `xml:"windowLeft,omitempty"`
      	WindowBottom    int      `xml:"windowBottom,omitempty"`
      	WindowRight     int      `xml:"windowRight,omitempty"`
      }

        Head Elements

        type OPML

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

          OPML elements

          func FromFile

          func FromFile(path string) (*OPML, error)

            FromFile will read the xml file

            func Read

            func Read(r io.Reader) (*OPML, error)

              Read the xml from a reader

              func (*OPML) Write

              func (o *OPML) Write(path string) error

                Write the structure to a file as XML

                func (*OPML) XML

                func (o *OPML) XML() ([]byte, error)

                  XML will convert the structure to XML

                  type Outline

                  type Outline struct {
                  	XMLName     xml.Name   `xml:"outline"`
                  	Text        string     `xml:"text,attr"`
                  	Description string     `xml:"description,attr,omitempty"`
                  	HTMLURL     string     `xml:"htmlUrl,attr,omitempty"`
                  	Language    string     `xml:"language,attr,omitempty"`
                  	Title       string     `xml:"title,attr,omitempty"`
                  	Type        string     `xml:"type,attr,omitempty"`
                  	Version     string     `xml:"version,attr,omitempty"`
                  	XMLURL      string     `xml:"xmlUrl,attr,omitempty"`
                  	Created     string     `xml:"created,attr,omitempty"`
                  	Outlines    []*Outline `xml:"outline"`
                  }

                    Outline elements

                    Source Files