model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package model defines data structures for external API responses and RSS feeds.

Package model defines data structures for external API responses and RSS feeds.

Package model defines data structures for external API responses and RSS feeds.

Package model defines data structures for external API responses and RSS feeds.

Package model defines data structures for external API responses and RSS feeds.

Package model defines data structures for external API responses and RSS feeds.

Package model defines data structures for external API responses and RSS feeds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonSearchResultModel

type CommonSearchResultModel struct {
	URL          string   `json:"url"`
	Title        string   `json:"title"`
	Image        string   `json:"image"`
	Description  string   `json:"description"`
	Categories   []string `json:"categories"`
	AlreadySaved bool     `json:"already_saved"`
}

CommonSearchResultModel represents common search result model data.

type EpisodeSort

type EpisodeSort string

EpisodeSort represents episode sorting options.

const (
	// ReleaseAsc sorts episodes by release date in ascending order.
	ReleaseAsc EpisodeSort = "release_asc"
	// ReleaseDesc sorts episodes by release date in descending order.
	ReleaseDesc EpisodeSort = "release_desc"
	// DurationAsc sorts episodes by duration in ascending order.
	DurationAsc EpisodeSort = "duration_asc"
	// DurationDesc sorts episodes by duration in descending order.
	DurationDesc EpisodeSort = "duration_desc"
)

type EpisodesFilter

type EpisodesFilter struct {
	DownloadStatus *string     `uri:"downloadStatus" query:"downloadStatus" json:"downloadStatus" form:"downloadStatus"`
	EpisodeType    *string     `uri:"episodeType" query:"episodeType" json:"episodeType" form:"episodeType"`
	IsPlayed       *string     `uri:"isPlayed" query:"isPlayed" json:"isPlayed" form:"isPlayed"`
	Sorting        EpisodeSort `uri:"sorting" query:"sorting" json:"sorting" form:"sorting"`
	Q              string      `uri:"q" query:"q" json:"q" form:"q"`
	TagIDs         []string    `uri:"tagIDs" query:"tagIds[]" json:"tagIDs" form:"tagIds[]"`
	PodcastIDs     []string    `uri:"podcastIDs" query:"podcastIDs[]" json:"podcastIDs" form:"podcastIDs[]"`
	Pagination
}

EpisodesFilter represents episodes filter data.

func (*EpisodesFilter) SetCounts

func (filter *EpisodesFilter) SetCounts(totalCount int64)

SetCounts calculates and sets pagination metadata based on total count.

func (*EpisodesFilter) VerifyPaginationValues

func (filter *EpisodesFilter) VerifyPaginationValues()

VerifyPaginationValues sets default values for pagination parameters.

type GPodcast

type GPodcast struct {
	URL                 string `json:"url"`
	Title               string `json:"title"`
	Author              string `json:"author"`
	Description         string `json:"description"`
	LogoURL             string `json:"logo_url"`
	ScaledLogoURL       string `json:"scaled_logo_url"`
	Website             string `json:"website"`
	MygpoLink           string `json:"mygpo_link"`
	Subscribers         int    `json:"subscribers"`
	SubscribersLastWeek int    `json:"subscribers_last_week"`
	AlreadySaved        bool   `json:"already_saved"`
}

GPodcast represents g podcast data.

type GPodcastTag

type GPodcastTag struct {
	Tag   string `json:"tag"`
	Title string `json:"title"`
	Usage int    `json:"usage"`
}

GPodcastTag represents g podcast tag data.

type ItunesResponse

type ItunesResponse struct {
	Results     []ItunesSingleResult `json:"results"`
	ResultCount int                  `json:"resultCount"`
}

ItunesResponse represents itunes response data.

type ItunesSingleResult

type ItunesSingleResult struct {
	ReleaseDate            time.Time `json:"releaseDate"`
	ArtworkURL30           string    `json:"artworkUrl30"`
	CollectionViewURL      string    `json:"collectionViewUrl"`
	TrackExplicitness      string    `json:"trackExplicitness"`
	ArtistName             string    `json:"artistName"`
	CollectionName         string    `json:"collectionName"`
	TrackName              string    `json:"trackName"`
	CollectionCensoredName string    `json:"collectionCensoredName"`
	ArtworkURL60           string    `json:"artworkUrl60"`
	Country                string    `json:"country"`
	FeedURL                string    `json:"feedUrl"`
	ArtistViewURL          string    `json:"artistViewUrl,omitempty"`
	TrackViewURL           string    `json:"trackViewUrl"`
	TrackCensoredName      string    `json:"trackCensoredName"`
	ArtworkURL100          string    `json:"artworkUrl100"`
	CollectionExplicitness string    `json:"collectionExplicitness"`
	WrapperType            string    `json:"wrapperType"`
	ArtworkURL600          string    `json:"artworkUrl600"`
	ContentAdvisoryRating  string    `json:"contentAdvisoryRating,omitempty"`
	PrimaryGenreName       string    `json:"primaryGenreName"`
	Currency               string    `json:"currency"`
	Kind                   string    `json:"kind"`
	GenreIDs               []string  `json:"genreIds"`
	Genres                 []string  `json:"genres"`
	TrackPrice             float64   `json:"trackPrice"`
	TrackCount             int       `json:"trackCount"`
	TrackHdRentalPrice     int       `json:"trackHdRentalPrice"`
	TrackHdPrice           int       `json:"trackHdPrice"`
	CollectionHdPrice      int       `json:"collectionHdPrice"`
	TrackRentalPrice       int       `json:"trackRentalPrice"`
	CollectionPrice        float64   `json:"collectionPrice"`
	TrackID                int       `json:"trackId"`
	ArtistID               int       `json:"artistId,omitempty"`
	CollectionID           int       `json:"collectionId"`
}

ItunesSingleResult represents itunes single result data.

type OpmlBody

type OpmlBody struct {
	Text    string        `xml:",chardata"`
	Outline []OpmlOutline `xml:"outline"`
}

OpmlBody represents opml body data.

type OpmlExportHead

type OpmlExportHead struct {
	DateCreated time.Time `xml:"dateCreated"`
	Text        string    `xml:",chardata"`
	Title       string    `xml:"title"`
}

OpmlExportHead represents opml export head data.

type OpmlExportModel

type OpmlExportModel struct {
	XMLName xml.Name       `xml:"opml"`
	Text    string         `xml:",chardata"`
	Version string         `xml:"version,attr"`
	Head    OpmlExportHead `xml:"head"`
	Body    OpmlBody       `xml:"body"`
}

OpmlExportModel represents opml export model data.

type OpmlHead

type OpmlHead struct {
	Text  string `xml:",chardata"`
	Title string `xml:"title"`
}

OpmlHead represents opml head data.

type OpmlModel

type OpmlModel struct {
	XMLName xml.Name `xml:"opml"`
	Text    string   `xml:",chardata"`
	Version string   `xml:"version,attr"`
	Head    OpmlHead `xml:"head"`
	Body    OpmlBody `xml:"body"`
}

OpmlModel represents opml model data.

type OpmlOutline

type OpmlOutline struct {
	Title    string        `xml:"title,attr"`
	XMLURL   string        `xml:"xmlUrl,attr"`
	Text     string        `xml:",chardata"`
	AttrText string        `xml:"text,attr"`
	Type     string        `xml:"type,attr"`
	Outline  []OpmlOutline `xml:"outline"`
}

OpmlOutline represents opml outline data.

type Pagination

type Pagination struct {
	Page         int `uri:"page" query:"page" json:"page" form:"page" default:"1"`
	Count        int `uri:"count" query:"count" json:"count" form:"count" default:"20"`
	NextPage     int `uri:"nextPage" query:"nextPage" json:"nextPage" form:"nextPage"`
	PreviousPage int `uri:"previousPage" query:"previousPage" json:"previousPage" form:"previousPage"`
	TotalCount   int `uri:"totalCount" query:"totalCount" json:"totalCount" form:"totalCount"`
	TotalPages   int `uri:"totalPages" query:"totalPages" json:"totalPages" form:"totalPages"`
}

Pagination represents pagination data.

type PodcastAlreadyExistsError

type PodcastAlreadyExistsError struct {
	URL string
}

PodcastAlreadyExistsError represents podcast already exists error data.

func (*PodcastAlreadyExistsError) Error

func (e *PodcastAlreadyExistsError) Error() string

type PodcastData

type PodcastData struct {
	XMLName    xml.Name `xml:"rss"`
	Text       string   `xml:",chardata"`
	Itunes     string   `xml:"itunes,attr"`
	Atom       string   `xml:"atom,attr"`
	Media      string   `xml:"media,attr"`
	Psc        string   `xml:"psc,attr"`
	Omny       string   `xml:"omny,attr"`
	Content    string   `xml:"content,attr"`
	Googleplay string   `xml:"googleplay,attr"`
	Acast      string   `xml:"acast,attr"`
	Version    string   `xml:"version,attr"`
	Channel    struct {
		Text     string `xml:",chardata"`
		Language string `xml:"language"`
		Link     []struct {
			Text string `xml:",chardata"`
			Rel  string `xml:"rel,attr"`
			Type string `xml:"type,attr"`
			Href string `xml:"href,attr"`
		} `xml:"link"`
		Title       string `xml:"title"`
		Description string `xml:"description"`
		Type        string `xml:"type"`
		Summary     string `xml:"summary"`
		Owner       struct {
			Text  string `xml:",chardata"`
			Name  string `xml:"name"`
			Email string `xml:"email"`
		} `xml:"owner"`
		Author    string `xml:"author"`
		Copyright string `xml:"copyright"`
		Explicit  string `xml:"explicit"`
		Category  struct {
			Text     string `xml:",chardata"`
			AttrText string `xml:"text,attr"`
			Category struct {
				Text     string `xml:",chardata"`
				AttrText string `xml:"text,attr"`
			} `xml:"category"`
		} `xml:"category"`
		Image struct {
			Text  string `xml:",chardata"`
			Href  string `xml:"href,attr"`
			URL   string `xml:"url"`
			Title string `xml:"title"`
			Link  string `xml:"link"`
		} `xml:"image"`
		Item []struct {
			Enclosure struct {
				Text   string `xml:",chardata"`
				URL    string `xml:"url,attr"`
				Length string `xml:"length,attr"`
				Type   string `xml:"type,attr"`
			} `xml:"enclosure"`
			Image struct {
				Text string `xml:",chardata"`
				Href string `xml:"href,attr"`
			} `xml:"image"`
			GUID struct {
				Text        string `xml:",chardata"`
				IsPermaLink string `xml:"isPermaLink,attr"`
			} `xml:"guid"`
			Duration    string `xml:"duration"`
			ClipID      string `xml:"clipId"`
			EpisodeType string `xml:"episodeType"`
			Author      string `xml:"author"`
			Encoded     string `xml:"encoded"`
			Episode     string `xml:"episode"`
			Description string `xml:"description"`
			Summary     string `xml:"summary"`
			PubDate     string `xml:"pubDate"`
			Text        string `xml:",chardata"`
			Title       string `xml:"title"`
			Link        string `xml:"link"`
			StitcherID  string `xml:"stitcherId"`
			Content     []struct {
				Text   string `xml:",chardata"`
				URL    string `xml:"url,attr"`
				Type   string `xml:"type,attr"`
				Player struct {
					Text string `xml:",chardata"`
					URL  string `xml:"url,attr"`
				} `xml:"player"`
			} `xml:"content"`
		} `xml:"item"`
	} `xml:"channel"`
}

PodcastData is

type RssChannel

type RssChannel struct {
	Image       RssItemImage `xml:"image"`
	Text        string       `xml:",chardata"`
	Language    string       `xml:"language"`
	Link        string       `xml:"link"`
	Title       string       `xml:"title"`
	Description string       `xml:"description"`
	Type        string       `xml:"type"`
	Summary     string       `xml:"summary"`
	Author      string       `xml:"author"`
	Item        []RssItem    `xml:"item"`
}

RssChannel represents rss channel data.

type RssItem

type RssItem struct {
	Text        string           `xml:",chardata"`
	Title       string           `xml:"title"`
	Description string           `xml:"description"`
	Encoded     string           `xml:"encoded"`
	Summary     string           `xml:"summary"`
	EpisodeType string           `xml:"episodeType"`
	Author      string           `xml:"author"`
	Image       RssItemImage     `xml:"image"`
	GUID        RssItemGUID      `xml:"guid"`
	ClipID      string           `xml:"clipId"`
	PubDate     string           `xml:"pubDate"`
	Duration    string           `xml:"duration"`
	Enclosure   RssItemEnclosure `xml:"enclosure"`
	Link        string           `xml:"link"`
	Episode     string           `xml:"episode"`
}

RssItem represents rss item data.

type RssItemEnclosure

type RssItemEnclosure struct {
	Text   string `xml:",chardata"`
	URL    string `xml:"url,attr"`
	Length string `xml:"length,attr"`
	Type   string `xml:"type,attr"`
}

RssItemEnclosure represents rss item enclosure data.

type RssItemGUID

type RssItemGUID struct {
	Text        string `xml:",chardata"`
	IsPermaLink string `xml:"isPermaLink,attr"`
}

RssItemGUID represents rss item guid data.

type RssItemImage

type RssItemImage struct {
	Text string `xml:",chardata"`
	Href string `xml:"href,attr"`
	URL  string `xml:"url"`
}

RssItemImage represents rss item image data.

type RssPodcastData

type RssPodcastData struct {
	XMLName    xml.Name   `xml:"rss"`
	Text       string     `xml:",chardata"`
	Itunes     string     `xml:"itunes,attr"`
	Atom       string     `xml:"atom,attr"`
	Media      string     `xml:"media,attr"`
	Psc        string     `xml:"psc,attr"`
	Omny       string     `xml:"omny,attr"`
	Content    string     `xml:"content,attr"`
	Googleplay string     `xml:"googleplay,attr"`
	Acast      string     `xml:"acast,attr"`
	Version    string     `xml:"version,attr"`
	Channel    RssChannel `xml:"channel"`
}

RssPodcastData represents the root RSS feed structure for podcast data

type TagAlreadyExistsError

type TagAlreadyExistsError struct {
	Label string
}

TagAlreadyExistsError represents tag already exists error data.

func (*TagAlreadyExistsError) Error

func (e *TagAlreadyExistsError) Error() string

Jump to

Keyboard shortcuts

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