Documentation ¶
Index ¶
Constants ¶
const (
ReservedPodName = "all"
)
Variables ¶
var ( ErrPodExists = errors.New("podcast by that name already exists") ErrNoEntry = errors.New("no podcast is managed by that name") ErrReservedName = errors.New("the name " + ReservedPodName + " is reserved by gopodgrab") ErrArchiveEmpty = errors.New("feed file zip archive empty") )
Functions ¶
This section is empty.
Types ¶
type Episode ¶
type Podcast ¶
type Podcast struct { FeedURL string `json:"feed_url"` // URL to retrieve the podcast feed from Name string `json:"name"` // The name under which this podcast is managed LocalStore string `json:"local_store"` // Directory path of the local store for this podcast }
Podcast represents a podcast. It has a feed URL, name and additional metadata.
func Get ¶
Get returns a specific podcast from the configuration by name. If the podcast is not found by name, or the configuration file cannot be read, then an error is returned.
func List ¶
List returns the list of managed podcasts from the configuration file. Failure to read the configuration file results in a error.
func New ¶
New creates a new podcast and intializes the local storage for it. If creation of the local storage fails, or a podcast by that name is already managed by gopodgrab, an error is returned.
func (*Podcast) DownloadEpisodes ¶
DownloadEpisodes retrieves all episodes and stores them in the local storage. For each retrieved episode the size in bytes is recorded in Episode.Bytes.
func (*Podcast) NewEpisodes ¶
NewEpisodes reads the feed and compares the list of episodes in the feed against the one already in the local storage. It returns the difference feed - storage.
func (*Podcast) RefreshFeed ¶
RefreshFeed updates the locally stored feed from remote.