Documentation
¶
Index ¶
- type Client
- func (c *Client) DeleteEpisode(ctx context.Context, podcastID string, episodeID string, hardDelete bool) error
- func (c *Client) DeleteItem(ctx context.Context, itemID string, hardDelete bool) error
- func (c *Client) FilterAudioLibraries(ctx context.Context, libs []abs.Library) ([]abs.Library, error)
- func (c *Client) GetBookmarks(ctx context.Context, itemID string) ([]abs.Bookmark, error)
- func (c *Client) GetLibraries(ctx context.Context) ([]abs.Library, error)
- func (c *Client) GetLibraryItem(ctx context.Context, itemID string) (*abs.LibraryItem, error)
- func (c *Client) GetLibraryItems(ctx context.Context, libraryID string, page, limit int) (*abs.LibraryItemsResponse, error)
- func (c *Client) GetLibrarySeries(ctx context.Context, libraryID string, page, limit int) (*abs.LibrarySeriesResponse, error)
- func (c *Client) GetMediaProgress(ctx context.Context, itemID string) (*abs.MediaProgressWithBookmarks, error)
- func (c *Client) GetPersonalized(ctx context.Context, libraryID string) ([]abs.PersonalizedResponse, error)
- func (c *Client) GetRecentEpisodes(ctx context.Context, libraryID string, limit int) ([]abs.LibraryItem, error)
- func (c *Client) GetRecentlyAdded(ctx context.Context, libraries []abs.Library) ([]abs.LibraryItem, error)
- func (c *Client) GetSeries(ctx context.Context, libraryID, seriesID string) (*abs.Series, error)
- func (c *Client) GetSeriesContents(ctx context.Context, libraryID, seriesID string) (*abs.SeriesContents, error)
- func (c *Client) UpdateLibraryItemMedia(ctx context.Context, itemID string, req abs.UpdateMediaRequest) (*abs.LibraryItem, error)
- func (c *Client) UpdatePodcastEpisode(ctx context.Context, itemID, episodeID string, ...) (*abs.LibraryItem, error)
- type Store
- func (s *Store) ClearAll() error
- func (s *Store) Delete(key string) error
- func (s *Store) EvictExpired() error
- func (s *Store) Get(key string, dest any) (bool, error)
- func (s *Store) GetBookmarks(itemID string) ([]abs.Bookmark, bool, error)
- func (s *Store) GetFilteredLibraries() ([]abs.Library, bool, error)
- func (s *Store) GetLibraries() ([]abs.Library, bool, error)
- func (s *Store) GetLibraryItem(itemID string) (*abs.LibraryItem, bool, error)
- func (s *Store) GetLibraryItems(libID string, page, limit int) ([]abs.LibraryItem, int, bool, error)
- func (s *Store) GetLibrarySeries(libID string, page, limit int) ([]abs.Series, int, bool, error)
- func (s *Store) GetMediaProgress(itemID string) (*abs.MediaProgressWithBookmarks, bool, error)
- func (s *Store) GetPersonalized(libID string) ([]abs.PersonalizedResponse, bool, error)
- func (s *Store) GetRecentEpisodes(libID string, limit int) ([]abs.LibraryItem, bool, error)
- func (s *Store) GetRecentlyAdded() ([]abs.LibraryItem, bool, error)
- func (s *Store) GetSeries(seriesID string) (*abs.Series, bool, error)
- func (s *Store) GetSeriesContents(seriesID string) ([]abs.LibraryItem, bool, error)
- func (s *Store) Put(key string, value any, ttl time.Duration) error
- func (s *Store) PutBookmarks(itemID string, v []abs.Bookmark, ttl time.Duration) error
- func (s *Store) PutFilteredLibraries(v []abs.Library, ttl time.Duration) error
- func (s *Store) PutLibraries(v []abs.Library, ttl time.Duration) error
- func (s *Store) PutLibraryItem(itemID string, v *abs.LibraryItem, ttl time.Duration) error
- func (s *Store) PutLibraryItems(libID string, page, limit int, items []abs.LibraryItem, total int, ...) error
- func (s *Store) PutLibrarySeries(libID string, page, limit int, items []abs.Series, total int, ...) error
- func (s *Store) PutMediaProgress(itemID string, v *abs.MediaProgressWithBookmarks, ttl time.Duration) error
- func (s *Store) PutPersonalized(libID string, v []abs.PersonalizedResponse, ttl time.Duration) error
- func (s *Store) PutRecentEpisodes(libID string, limit int, v []abs.LibraryItem, ttl time.Duration) error
- func (s *Store) PutRecentlyAdded(v []abs.LibraryItem, ttl time.Duration) error
- func (s *Store) PutSeries(seriesID string, v *abs.Series, ttl time.Duration) error
- func (s *Store) PutSeriesContents(seriesID string, v []abs.LibraryItem, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a transparent caching wrapper around abs.Client.
func (*Client) DeleteEpisode ¶ added in v0.4.0
func (c *Client) DeleteEpisode(ctx context.Context, podcastID string, episodeID string, hardDelete bool) error
DeleteEpisode deletes a podcast episode from the API and invalidates related caches.
func (*Client) DeleteItem ¶ added in v0.4.0
DeleteItem deletes a library item from the API and invalidates related caches.
func (*Client) FilterAudioLibraries ¶
func (c *Client) FilterAudioLibraries(ctx context.Context, libs []abs.Library) ([]abs.Library, error)
FilterAudioLibraries filters audio libraries using cache or fetches from the API.
func (*Client) GetBookmarks ¶
GetBookmarks returns bookmarks from cache or fetches from the API.
func (*Client) GetLibraries ¶
GetLibraries returns libraries from cache or fetches from the API.
func (*Client) GetLibraryItem ¶
GetLibraryItem returns a single library item from cache or fetches from the API.
func (*Client) GetLibraryItems ¶
func (c *Client) GetLibraryItems(ctx context.Context, libraryID string, page, limit int) (*abs.LibraryItemsResponse, error)
GetLibraryItems returns a paginated list of library items from cache or fetches from the API.
func (*Client) GetLibrarySeries ¶
func (c *Client) GetLibrarySeries(ctx context.Context, libraryID string, page, limit int) (*abs.LibrarySeriesResponse, error)
GetLibrarySeries returns a paginated list of series from cache or fetches from the API.
func (*Client) GetMediaProgress ¶
func (c *Client) GetMediaProgress(ctx context.Context, itemID string) (*abs.MediaProgressWithBookmarks, error)
GetMediaProgress returns media progress from cache or fetches from the API.
func (*Client) GetPersonalized ¶
func (c *Client) GetPersonalized(ctx context.Context, libraryID string) ([]abs.PersonalizedResponse, error)
GetPersonalized returns personalized shelves from cache or fetches from the API.
func (*Client) GetRecentEpisodes ¶
func (c *Client) GetRecentEpisodes(ctx context.Context, libraryID string, limit int) ([]abs.LibraryItem, error)
GetRecentEpisodes returns recent podcast episodes from cache or fetches from the API.
func (*Client) GetRecentlyAdded ¶
func (c *Client) GetRecentlyAdded(ctx context.Context, libraries []abs.Library) ([]abs.LibraryItem, error)
GetRecentlyAdded returns the merged recently-added shelf from cache or fetches from the API.
func (*Client) GetSeriesContents ¶
func (c *Client) GetSeriesContents(ctx context.Context, libraryID, seriesID string) (*abs.SeriesContents, error)
GetSeriesContents returns series contents from cache or fetches from the API.
func (*Client) UpdateLibraryItemMedia ¶ added in v0.4.0
func (c *Client) UpdateLibraryItemMedia(ctx context.Context, itemID string, req abs.UpdateMediaRequest) (*abs.LibraryItem, error)
UpdateLibraryItemMedia updates media metadata and invalidates caches.
func (*Client) UpdatePodcastEpisode ¶ added in v0.4.0
func (c *Client) UpdatePodcastEpisode(ctx context.Context, itemID, episodeID string, req abs.UpdatePodcastEpisodeRequest) (*abs.LibraryItem, error)
UpdatePodcastEpisode updates episode metadata and invalidates caches.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides generic get/put/delete/evict operations over a SQLite table.
func (*Store) EvictExpired ¶
EvictExpired removes all expired entries.
func (*Store) Get ¶
Get attempts to retrieve and decode the value for key into dest. Returns (true, nil) on hit, (false, nil) on miss.
func (*Store) GetBookmarks ¶
func (*Store) GetFilteredLibraries ¶
func (*Store) GetLibraryItem ¶
func (*Store) GetLibraryItems ¶
func (*Store) GetLibrarySeries ¶
func (*Store) GetMediaProgress ¶
func (*Store) GetPersonalized ¶
func (*Store) GetRecentEpisodes ¶
func (*Store) GetRecentlyAdded ¶
func (s *Store) GetRecentlyAdded() ([]abs.LibraryItem, bool, error)