cli + tui to publish to leaflet (wip) & manage tasks, notes & watch/read lists 馃崈
charm
leaflet
readability
golang
1package handlers
2
3import (
4 "context"
5 "io"
6)
7
8// MediaHandler defines common operations for media handlers and captures the shared behavior across media handlers for polymorphic handling of different media types.
9type MediaHandler interface {
10 SearchAndAdd(ctx context.Context, query string, interactive bool) error // SearchAndAdd searches for media and allows user to select and add to queue
11 List(ctx context.Context, status string) error // List lists all media items with optional status filtering
12 UpdateStatus(ctx context.Context, id, status string) error // UpdateStatus changes the status of a media item
13 Remove(ctx context.Context, id string) error // Remove removes a media item from the queue
14 SetInputReader(reader io.Reader) // SetInputReader sets the input reader for interactive prompts
15 Close() error // Close cleans up resources
16}
17
18// Searchable defines search behavior for media handlers
19type Searchable interface {
20 SearchAndAdd(ctx context.Context, query string, interactive bool) error
21}
22
23// Listable defines list behavior for media handlers
24type Listable interface {
25 List(ctx context.Context, status string) error
26}
27
28// StatusUpdatable defines status update behavior for media handlers
29type StatusUpdatable interface {
30 UpdateStatus(ctx context.Context, id, status string) error
31}
32
33// Removable defines remove behavior for media handlers
34type Removable interface {
35 Remove(ctx context.Context, id string) error
36}