favorites

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrItemNotFound = errors.New("playlist item not found")
	ErrNotFound     = errors.New("favorite not found")
)

Functions

This section is empty.

Types

type Favorite

type Favorite struct {
	FavID       int64  `json:"fav_id"`
	ItemKey     string `json:"item_key"`
	OrderIndex  int    `json:"order_index"`
	GuideNumber string `json:"guide_number"`
	GuideName   string `json:"guide_name"`
	Enabled     bool   `json:"enabled"`
	StreamURL   string `json:"stream_url,omitempty"`
	GroupName   string `json:"group_name,omitempty"`
}

Favorite is a curated channel exposed in HDHomeRun lineup responses.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides business operations for favorites CRUD + reorder.

func NewService

func NewService(store Store) *Service

func (*Service) Add

func (s *Service) Add(ctx context.Context, itemKey string) (Favorite, error)

func (*Service) List

func (s *Service) List(ctx context.Context) ([]Favorite, error)

func (*Service) ListEnabled

func (s *Service) ListEnabled(ctx context.Context) ([]Favorite, error)

func (*Service) Remove

func (s *Service) Remove(ctx context.Context, favID int64) error

func (*Service) Reorder

func (s *Service) Reorder(ctx context.Context, favIDs []int64) error

type Store

type Store interface {
	AddFavorite(ctx context.Context, itemKey string, startGuideNumber int) (Favorite, error)
	RemoveFavorite(ctx context.Context, favID int64, startGuideNumber int) error
	ListFavorites(ctx context.Context, enabledOnly bool) ([]Favorite, error)
	ReorderFavorites(ctx context.Context, favIDs []int64, startGuideNumber int) error
}

Store captures persistence operations required by favorites service.

Jump to

Keyboard shortcuts

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