service

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 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)
}

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) WriteAllAudiobooksFeed

func (s *Service) WriteAllAudiobooksFeed(ctx context.Context, writer io.Writer) 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

Jump to

Keyboard shortcuts

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