service

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudiobooksClient

type AudiobooksClient interface {
	GetAllAudiobooks(ctx context.Context) ([]audiobooks.Audiobook, error)
	GetAudiobooksByGenre(ctx context.Context, genre audiobooks.Genre) ([]audiobooks.Audiobook, error)
	GetAudiobooksByAuthor(ctx context.Context, author string) (books []audiobooks.Audiobook, err error)
	GetAudiobooksByNarrator(ctx context.Context, narrator string) (books []audiobooks.Audiobook, err error)
	UpdateAudiobooks(ctx context.Context) error
}

type FeedOpts

type FeedOpts struct {
	Title       string
	Description string
	Link        string
	ImageLink   string
	Explicit    bool
	Language    string
	Author      string
	Email       string
	Copyright   string
}

type Option

type Option func(s *Service)

func WithHandlePreUnixEpoch

func WithHandlePreUnixEpoch(handle bool) Option

func WithHost

func WithHost(host string) Option

func WithMediaPath

func WithMediaPath(mediaPath string) Option

func WithPodcastFeedInfo

func WithPodcastFeedInfo(explicit bool, language, author, email, copyright, imageLink string) Option

type Service

type Service struct {
	Log loggerrific.Logger

	AudiobooksClient
	// contains filtered or unexported fields
}

func New

func New(audiobooksClient AudiobooksClient, logger loggerrific.Logger, opts ...Option) *Service

func (*Service) GetFeed

func (s *Service) GetFeed(ctx context.Context, feedOpts *FeedOpts) (string, error)

func (*Service) IsReady

func (s *Service) IsReady(ctx context.Context) bool

func (*Service) UpdateFeeds added in v1.11.0

func (s *Service) UpdateFeeds(ctx context.Context) error

func (*Service) WriteAllAudiobooksFeed

func (s *Service) WriteAllAudiobooksFeed(ctx context.Context, writer io.Writer) error

func (*Service) WriteAuthorAudiobookFeed added in v1.12.0

func (s *Service) WriteAuthorAudiobookFeed(ctx context.Context, author string, writer io.Writer) (bool, error)

func (*Service) WriteFeed

func (s *Service) WriteFeed(ctx context.Context, feedOpts *FeedOpts, writer io.Writer) error

func (*Service) WriteFeedFromAudiobooks

func (s *Service) WriteFeedFromAudiobooks(ctx context.Context, books []audiobooks.Audiobook, feedOpts *FeedOpts, writer io.Writer) error

func (*Service) WriteGenreAudiobookFeed added in v1.7.2

func (s *Service) WriteGenreAudiobookFeed(ctx context.Context, genre audiobooks.Genre, writer io.Writer) error

func (*Service) WriteNarratorAudiobookFeed added in v1.12.0

func (s *Service) WriteNarratorAudiobookFeed(ctx context.Context, narrator string, writer io.Writer) (bool, error)

Jump to

Keyboard shortcuts

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