Documentation
¶
Index ¶
- Constants
- func FeedError(message string, rfcSection string) error
- type AtomAuthor
- type AtomCategory
- type AtomContent
- type AtomContributor
- type AtomDate
- type AtomEmail
- type AtomEntry
- func (entry *AtomEntry) AddCategory(term string, scheme string, label string) error
- func (entry *AtomEntry) AddLink(href string, rel AtomRelType) error
- func (entry *AtomEntry) SetContent(content string, contentType string) error
- func (entry *AtomEntry) SetPublished(published time.Time) error
- func (entry *AtomEntry) SetSummary(text string, textType string) error
- func (entry AtomEntry) String() string
- func (entry AtomEntry) Validate() error
- type AtomFeed
- func (feed *AtomFeed) AddAuthor(name string, uri string, email string) error
- func (feed *AtomFeed) AddCategory(term string, scheme string, label string) error
- func (feed *AtomFeed) AddEntry(entry *AtomEntry) error
- func (feed *AtomFeed) AddLink(href string, rel AtomRelType) error
- func (feed *AtomFeed) SetCopyright(text string, textType string) error
- func (feed *AtomFeed) SetLogo(uri string) error
- func (feed *AtomFeed) SetSubtitle(text string, textType string) error
- func (feed *AtomFeed) SetTitle(text string, textType string) error
- func (feed *AtomFeed) SetUpdated(date time.Time) 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 = "Feedme"
View Source
const PKG = "github.com/bossley9/feedme"
View Source
const VERSION = "v0.4.0"
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 ¶
func (*AtomEntry) AddCategory ¶
func (*AtomEntry) SetContent ¶
func (*AtomEntry) SetSummary ¶
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 (*AtomFeed) AddCategory ¶
func (*AtomFeed) SetCopyright ¶
func (*AtomFeed) SetSubtitle ¶
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 ¶
type AtomPersonConstruct struct {
Name AtomName `xml:"name"` // required
Uri AtomURI `xml:"uri,omitempty"`
Email AtomEmail `xml:"email,omitempty"`
}
func (AtomPersonConstruct) Validate ¶
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 ¶
type AtomTextConstruct struct {
Type AtomTextType `xml:"type,attr,omitempty"`
Text string `xml:",chardata"` // required
}
func (AtomTextConstruct) Validate ¶
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.