podcatch/structs/structs.go

45 lines
1.1 KiB
Go
Raw Normal View History

2021-05-24 20:30:56 +02:00
package structs
2021-05-24 21:58:15 +02:00
import (
"encoding/xml"
)
2021-05-24 23:05:12 +02:00
type Settings struct {
Directory string
Limit int
}
2021-05-24 20:30:56 +02:00
type Podcast struct {
URL string
2021-05-24 21:58:15 +02:00
Name string
Directory string
RSS Rss
}
type Rss struct {
XMLName xml.Name `xml:"rss"`
Version string `xml:"version,attr"`
Channel Channel `xml:"channel"`
Description string `xml:"description"`
Title string `xml:"title"`
Link string `xml:"link"`
}
type Channel struct {
XMLName xml.Name `xml:"channel"`
Title string `xml:"title"`
Link string `xml:"link"`
Description string `xml:"description"`
Items []Item `xml:"item"`
}
type Item struct {
XMLName xml.Name `xml:"item"`
Title string `xml:"title"`
2021-05-24 23:05:12 +02:00
Episode string `xml:"episode"`
2021-05-24 21:58:15 +02:00
Link string `xml:"link"`
Description string `xml:"description"`
PubDate string `xml:"pubdate"`
Guid string `xml:"guid"`
Media Media `xml:"enclosure"`
}
type Media struct {
XMLName xml.Name `xml:"enclosure"`
URL string `xml:"url,attr"`
Type string `xml:"type,attr"`
2021-05-24 20:30:56 +02:00
}