atom

package
v0.0.0-...-dfe31ac Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const AtomMime = "application/atom+xml"
View Source
const AtomNs = "http://www.w3.org/2005/Atom"

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomAuthor

type AtomAuthor struct {
	Name  string `xml:"name"` // Required!
	Uri   string `xml:"uri,omitempty"`
	Email string `xml:"email,omitempty"`
}

func NewAtomAuthor

func NewAtomAuthor(name string) *AtomAuthor

type AtomContent

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

func NewAtomContent

func NewAtomContent(text string) *AtomContent

type AtomEntry

type AtomEntry struct {
	Id         string       `xml:"id"`    // Required!
	Title      string       `xml:"title"` // Required!
	Published  string       `xml:"published,omitempty"`
	Updated    string       `xml:"updated"`          // Required!
	Author     *AtomAuthor  `xml:"author,omitempty"` // Required if feed has no author
	Link       *AtomLink    `xml:"link,omitempty"`
	Summary    *AtomContent `xml:"summary,omitempty"`
	Content    *AtomContent `xml:"content"` // Required!
	Categories []string     `xml:"category,omitempty"`
}

func NewAtomEntry

func NewAtomEntry(e *models.Entry) *AtomEntry

type AtomFeed

type AtomFeed struct {
	XMLName   xml.Name     `xml:"feed"`
	Xmlns     string       `xml:"xmlns,attr"`
	Generator string       `xml:"generator"`
	Language  string       `xml:"xml:lang,attr"`
	Id        string       `xml:"id"`    // Required!
	Title     string       `xml:"title"` // Required!
	Subtitle  string       `xml:"subtitle,omitempty"`
	Published string       `xml:"published,omitempty"`
	Updated   string       `xml:"updated"` // Required!
	Links     []*AtomLink  `xml:"link"`    // Self link + normal link
	Author    *AtomAuthor  `xml:"author,omitempty"`
	Entries   []*AtomEntry `xml:"entry"`
}

func NewAtomFeed

func NewAtomFeed(f *models.Feed) *AtomFeed
type AtomLink struct {
	Href string `xml:"href,attr"`
	Rel  string `xml:"rel,attr,omitempty"`
	Type string `xml:"type,attr,omitempty"`
}
func NewLink(href string) *AtomLink
func NewSelfLink(href string, mime string) *AtomLink

Jump to

Keyboard shortcuts

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