tail

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type      EventType
	Timestamp time.Time
	Previous  *core.PlaybackState
	Current   *core.PlaybackState
}

Event represents a playback state change.

type EventType

type EventType int

EventType represents the type of playback event.

const (
	EventTrackChange EventType = iota
	EventTrackComplete
	EventTrackSkip
	EventPause
	EventResume
	EventVolumeChange
	EventDeviceChange
)

type Formatter

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

Formatter formats events for output.

func NewFormatter

func NewFormatter(opts ...FormatterOption) *Formatter

NewFormatter creates a new formatter with the given options.

func (*Formatter) Format

func (f *Formatter) Format(e Event) string

Format formats an event as a string.

type FormatterOption

type FormatterOption func(*Formatter)

FormatterOption configures a Formatter.

func WithEmoji

func WithEmoji(enabled bool) FormatterOption

WithEmoji enables emoji output.

func WithTemplate

func WithTemplate(tmpl string) FormatterOption

WithTemplate sets a custom format template.

func WithTimestamp

func WithTimestamp(enabled bool) FormatterOption

WithTimestamp enables timestamp output.

type Watcher

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

Watcher polls a player for state changes and emits events.

func NewWatcher

func NewWatcher(player core.Player, interval time.Duration) *Watcher

NewWatcher creates a new state watcher.

func (*Watcher) Events

func (w *Watcher) Events() <-chan Event

Events returns the channel of playback events.

func (*Watcher) Start

func (w *Watcher) Start(ctx context.Context) error

Start begins polling for state changes.

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stops the watcher.

Jump to

Keyboard shortcuts

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