utils

package
v0.0.0-...-f6d0692 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Currency

type Currency struct {
	Symbol string
	Value  float64
}

type CurrencyFeed

type CurrencyFeed struct {
	Items []FeedItem
}

func (*CurrencyFeed) ParseItem

func (f *CurrencyFeed) ParseItem(date string, content string) error

ParseItem parses currency feed item and appends results to the CurrencyFeed items list

type FeedItem

type FeedItem struct {
	Date       time.Time
	Currencies []Currency
}

type Image

type Image struct {
	Url    string `xml:"url"`
	Title  string `xml:"title"`
	Link   string `xml:"link"`
	Width  int    `xml:"width"`
	Height int    `xml:"height"`
}

type Item

type Item struct {
	// Required
	Title       string `xml:"title"`
	Link        string `xml:"link"`
	Description string `xml:"description"`

	// Optional
	GUID    string `xml:"guid"`
	PubDate string `xml:"pubDate"`
}

type RSS2

type RSS2 struct {
	XMLName xml.Name `xml:"rss"`
	Version string   `xml:"version,attr"`

	// Required
	Title       string `xml:"channel>title"`
	Link        string `xml:"channel>link"`
	Description string `xml:"channel>description"`

	// Optional
	BuiltAt   string `xml:"channel>lastBuildDate"`
	Generator string `xml:"channel>generator"`
	Image     Image  `xml:"channel>image"`
	Language  string `xml:"channel>language"`
	TTL       int    `xml:"channel>ttl"`
	Items     []Item `xml:"channel>item"`
}

func (*RSS2) Parse

func (r *RSS2) Parse(content []byte) error

Parse XML/RSS2 file contents

Jump to

Keyboard shortcuts

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