atom

package
v0.0.0-...-5dab7ed Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2016 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Term   string `xml:"term,attr"`
	Scheme string `xml:"scheme,attr,omitempty"`
	Label  string `xml:"label,attr,omitempty"`
}

CategoryはAtom文書におけるCategory要素をあらわす。

type Entry

type Entry struct {
	Title      Text       `xml:"title"`
	Links      []Link     `xml:"link,omitempty"`
	Authors    []Person   `xml:"author,omitempty"`
	Categories []Category `xml:"category,omitempty"`
	ID         string     `xml:"id"`
	Updated    time.Time  `xml:"updated"`
	Published  time.Time  `xml:"published,omitempty"`
	Rights     Text       `xml:"rights,omitempty"`
	Summary    Text       `xml:"summary,omitempty"`
	Content    Text       `xml:"content,omitempty"`

	// atom 0.3 compatibility
	Modified time.Time `xml:"modified,omitempty"`
	Issued   time.Time `xml:"issued,omitempty"`
}

EntryはAtom文書におけるEntry要素をあらわす。

func (*Entry) AlternateURL

func (entry *Entry) AlternateURL() string

func (*Entry) Article

func (entry *Entry) Article() string

func (*Entry) PublishedTime

func (entry *Entry) PublishedTime() time.Time

func (*Entry) UpdatedTime

func (entry *Entry) UpdatedTime() time.Time

type Feed

type Feed struct {
	XMLName xml.Name `xml:"feed"`

	Title      Text       `xml:"title"`
	Subtitle   Text       `xml:"subtitle,omitempty"`
	Links      []Link     `xml:"link"`
	Authors    []Person   `xml:"author"`
	ID         string     `xml:"id"`
	Rights     Text       `xml:"rights,omitempty"`
	Updated    time.Time  `xml:"updated"`
	Summary    string     `xml:"summary,omitempty"`
	Categories []Category `xml:"category,omitempty"`
	Entries    []*Entry   `xml:"entry"`
}

FeedはAtom文書におけるFeed要素をあらわす。

func Parse

func Parse(r io.Reader) (feed *Feed, err error)

func (*Feed) AlternateURL

func (feed *Feed) AlternateURL() string
type Link struct {
	Rel  string `xml:"rel,attr,omitempty"`
	Type string `xml:"type,attr,omitempty"`
	URL  string `xml:"href,attr"`
}

LinkはAtom文書におけるLinkコンストラクトをあらわす。

type Person

type Person struct {
	Name  string `xml:"name"`
	URL   string `xml:"uri,omitempty"`
	Email string `xml:"email,omitempty"`
}

PersonはAtom文書におけるPersonコンストラクトをあらわす。

type Text

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

TextはAtom文書におけるTextコンストラクトをあらわす。

func (Text) HTML

func (t Text) HTML() (s string, err error)

func (Text) IsZero

func (t Text) IsZero() bool

IsZeroはtが空だった場合にtrueを返す。

func (Text) Plain

func (t Text) Plain() (s string, err error)

Jump to

Keyboard shortcuts

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