rss

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

README

rss

This package is used for creating RSS feeds.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	XMLName        xml.Name `xml:"channel"`
	Title          string   `xml:"title"`
	Link           string   `xml:"link"`
	Description    string   `xml:"description"`
	Language       string   `xml:"language,omitempty"`
	Copyright      string   `xml:"copyright,omitempty"`
	ManagingEditor string   `xml:"managingEditor,omitempty"`
	WebMaster      string   `xml:"webMaster,omitempty"`
	PubDate        string   `xml:"pubDate,omitempty"`
	LastBuildDate  string   `xml:"lastBuildDate,omitempty"`
	Categories     []string `xml:"category,omitempty"`
	Generator      string   `xml:"generator,omitempty"`
	Docs           string   `xml:"docs,omitempty"`
	Cloud          string   `xml:"cloud,omitempty"`
	Image          *Image
	Rating         string `xml:"rating,omitempty"`
	TextInput      *TextInput
	SkipHours      []int `xml:"skipHours,omitempty"`
	SkipDays       []int `xml:"skipDays,omitempty"`
	Items          []*Item
	Ttl            int `xml:"ttl,omitempty"`
}

type Content

type Content struct {
	XMLName xml.Name `xml:"content:encoded"`
	Value   string   `xml:",cdata"`
}

type Enclosure

type Enclosure struct {
	XMLName xml.Name `xml:"enclosure"`
	Url     string   `xml:"url,attr"`
	Type    string   `xml:"type,attr"`
	Lenght  int      `xml:"lenght,attr"`
}

type Feed

type Feed struct {
	XMLName          xml.Name `xml:"rss"`
	Version          string   `xml:"version,attr"`
	ContentNamespace string   `xml:"xmlns:content,attr"`
	Channels         []*Channel
}

func NewFeed

func NewFeed() *Feed

func (*Feed) ToXML

func (f *Feed) ToXML(encoding string) (string, error)

type Image

type Image struct {
	XMLName xml.Name `xml:"image"`
	Url     string   `xml:"url"`
	Title   string   `xml:"title"`
	Link    string   `xml:"link"`
	Width   int      `xml:"width,omitempty"`  // max: 144, default: 88
	Height  int      `xml:"height,omitempty"` // max: 400, default: 31
}

type Item

type Item struct {
	XMLName     xml.Name `xml:"item"`
	Title       string   `xml:"title,omitempty"`
	Link        string   `xml:"link,omitempty"`
	Description string   `xml:"description,omitempty"`
	Author      string   `xml:"author,omitempty"`
	Comments    string   `xml:"comments,omitempty"`
	Enclosure   *Enclosure
	Guid        string `xml:"guid,omitempty"`
	PubDate     string `xml:"pubDate,omitempty"`
	Source      *Source
	Content     *Content
	Categories  []string `xml:"category,omitempty"`
}

type Source

type Source struct {
	XMLName xml.Name `xml:"source"`
	Url     string   `xml:"url,attr"`
	Value   string
}

type TextInput

type TextInput struct {
	XMLName     xml.Name `xml:"textInput"`
	Title       string   `xml:"title,omitempty"`
	Description string   `xml:"description,omitempty"`
	Name        string   `xml:"name,omitempty"`
	Link        string   `xml:"link,omitempty"`
}

Jump to

Keyboard shortcuts

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