Documentation ¶
Index ¶
- Constants
- func FeedError(message string, rfcSection string) error
- type AtomAuthor
- type AtomCategory
- type AtomContent
- type AtomContributor
- type AtomDate
- type AtomEmail
- type AtomEntry
- type AtomFeed
- func (feed *AtomFeed) AddAuthor(name string, uri string, email string) error
- func (feed *AtomFeed) AddEntry(entry *AtomEntry) error
- func (feed *AtomFeed) AddLink(href string, rel AtomRelType) error
- func (feed *AtomFeed) SetSubtitle(text string, textType string) error
- func (feed AtomFeed) String() string
- func (feed AtomFeed) Validate() error
- type AtomGenerator
- type AtomID
- type AtomIcon
- type AtomLanguageTag
- type AtomLink
- type AtomLogo
- type AtomMediaType
- type AtomName
- type AtomPersonConstruct
- type AtomRelType
- type AtomRights
- type AtomSource
- type AtomSubtitle
- type AtomSummary
- type AtomTextConstruct
- type AtomTextType
- type AtomTitle
- type AtomURI
Constants ¶
View Source
const NAME = "Feed Generator"
View Source
const PKG = "git.sr.ht/~bossley9/feed-generator"
View Source
const VERSION = "v0.0.3"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AtomAuthor ¶
type AtomAuthor AtomPersonConstruct
type AtomCategory ¶
type AtomCategory struct { XMLName xml.Name `xml:"category"` Term string `xml:"term,attr"` // required Scheme AtomURI `xml:"scheme,attr,omitempty"` Label string `xml:"label,attr,omitempty"` // HTML-escaped }
self-closing element
func (AtomCategory) Validate ¶
func (category AtomCategory) Validate() error
type AtomContent ¶
type AtomContributor ¶
type AtomContributor AtomPersonConstruct
type AtomDate ¶
func (AtomDate) MarshalXML ¶
type AtomEntry ¶
type AtomEntry struct { XMLName xml.Name `xml:"entry"` Authors []AtomAuthor `xml:"author"` Categories []AtomCategory `xml:"category"` Content *AtomContent `xml:"content"` Contributors []AtomContributor `xml:"contributor"` Id AtomID `xml:"id"` // required Links []AtomLink `xml:"link"` Published *AtomDate `xml:"published,omitempty"` Rights *AtomRights `xml:"rights,omitempty"` Source *AtomSource `xml:"source,omitempty"` Summary *AtomSummary `xml:"summary,omitempty"` Title AtomTitle `xml:"title"` // required Updated AtomDate `xml:"updated"` // required }
func CreateFeedEntry ¶ added in v0.0.2
func (*AtomEntry) AddLink ¶ added in v0.0.2
func (entry *AtomEntry) AddLink(href string, rel AtomRelType) error
func (*AtomEntry) SetContent ¶ added in v0.0.2
func (*AtomEntry) SetPublished ¶ added in v0.0.2
type AtomFeed ¶
type AtomFeed struct { XMLName xml.Name `xml:"http://www.w3.org/2005/Atom feed"` Authors []AtomAuthor `xml:"author"` // >1 required Categories []AtomCategory `xml:"category"` Contributors []AtomContributor `xml:"contributor"` Generator AtomGenerator `xml:",omitempty"` Icon AtomIcon `xml:"icon,omitempty"` // should use aspect ratio 1(h):1(v) Id AtomID `xml:"id"` // required Links []AtomLink `xml:"link"` Logo AtomLogo `xml:"logo,omitempty"` // should use aspect ratio 2(h):1(v) Rights *AtomRights `xml:"rights,omitempty"` Subtitle *AtomSubtitle `xml:"subtitle,omitempty"` Title AtomTitle `xml:"title"` // required Updated AtomDate `xml:"updated"` // required Entries []AtomEntry `xml:"entry"` }
func CreateFeed ¶ added in v0.0.2
func (*AtomFeed) AddLink ¶ added in v0.0.2
func (feed *AtomFeed) AddLink(href string, rel AtomRelType) error
func (*AtomFeed) SetSubtitle ¶ added in v0.0.2
type AtomGenerator ¶
type AtomGenerator struct { Uri AtomURI `xml:"uri,attr"` Version string `xml:"version,attr"` Text string `xml:",innerxml"` }
func (AtomGenerator) MarshalXML ¶
func (generator AtomGenerator) MarshalXML(e *xml.Encoder, _ xml.StartElement) error
type AtomID ¶
type AtomID AtomURI
atom:id elements must ALWAYS assure uniqueness. See https://datatracker.ietf.org/doc/html/rfc4287#section-4.2.6 for strategies on generating unique id elements.
type AtomLanguageTag ¶
type AtomLink ¶
type AtomLink struct { XMLName xml.Name `xml:"link"` Href AtomURI `xml:"href,attr"` // required Rel AtomRelType `xml:"rel,attr,omitempty"` Type AtomMediaType `xml:"type,attr,omitempty"` HrefLang AtomLanguageTag `xml:"hreflang,attr,omitempty"` Title string `xml:"title,attr,omitempty"` // HTML-escaped Length uint `xml:"length,attr,omitempty"` }
self-closing element
type AtomMediaType ¶
type AtomMediaType string // MIME media type
type AtomPersonConstruct ¶ added in v0.0.2
type AtomPersonConstruct struct { Name AtomName `xml:"name"` // required Uri AtomURI `xml:"uri,omitempty"` Email AtomEmail `xml:"email,omitempty"` }
func (AtomPersonConstruct) Validate ¶ added in v0.0.2
func (person AtomPersonConstruct) Validate() error
type AtomRelType ¶
type AtomRelType int
const ( RelUnknown AtomRelType = iota RelAlternate RelRelated RelSelf RelEnclosure RelVia )
func (AtomRelType) MarshalText ¶
func (rel AtomRelType) MarshalText() ([]byte, error)
type AtomRights ¶
type AtomRights AtomTextConstruct
type AtomSource ¶
type AtomSource struct{} // extension of atom:feed without entries
unimplemented due to language constraints
type AtomSubtitle ¶
type AtomSubtitle AtomTextConstruct
type AtomSummary ¶
type AtomSummary AtomTextConstruct
type AtomTextConstruct ¶ added in v0.0.2
type AtomTextConstruct struct { Type AtomTextType `xml:"type,attr,omitempty"` Text string `xml:",chardata"` // required }
func (AtomTextConstruct) Validate ¶ added in v0.0.2
func (text AtomTextConstruct) Validate() error
type AtomTextType ¶
type AtomTextType string // one of "text", "html", "xhtml" - default "text"
type AtomTitle ¶
type AtomTitle AtomTextConstruct
Click to show internal directories.
Click to hide internal directories.