atom

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2016 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Title     string  `xml:"title"`
	ID        string  `xml:"id"`
	Link      []Link  `xml:"link"`
	Published TimeStr `xml:"published"`
	Updated   TimeStr `xml:"updated"`
	Author    *Person `xml:"author"`
	Summary   *Text   `xml:"summary"`
	Content   *Text   `xml:"content"`
}

Entry represents a feed entry.

type Feed

type Feed struct {
	XMLName      xml.Name `xml:"http://www.w3.org/2005/Atom feed"`
	Title        string   `xml:"title"`
	ID           string   `xml:"id"`
	StreamID     string   `xml:"streamId"`
	HeadOfStream bool     `xml:"headOfStream"`
	Link         []Link   `xml:"link"`
	Updated      TimeStr  `xml:"updated"`
	Author       *Person  `xml:"author"`
	Entry        []*Entry `xml:"entry"`
}

Feed represents an atom feed page from the eventstore.

func (*Feed) GetEventURLs

func (f *Feed) GetEventURLs() ([]string, error)

GetEventURLs extracts a slice of event urls from the feed object.

func (f *Feed) GetLink(name string) *Link

GetLink gets the link with the name specified by the link argument.

func (*Feed) PrettyPrint

func (f *Feed) PrettyPrint() string

PrettyPrint returns an indented string representation of the feed.

type Link struct {
	Rel  string `xml:"rel,attr"`
	Href string `xml:"href,attr"`
}

Link represents a Link entry in the feed.

type Person

type Person struct {
	Name string `xml:"name"`
}

Person represents a person

type Text

type Text struct {
	Type string `xml:"type,attr,omitempty"`
	Body string `xml:",chardata"`
}

Text represents a text entry

type TimeStr

type TimeStr string

TimeStr is a formatted time string

func Time

func Time(t time.Time) TimeStr

Time returns a TimeStr

Jump to

Keyboard shortcuts

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