output

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package output handles formatting and displaying results to the terminal.

It supports multiple output formats:

  • table: Human-readable aligned columns (default)
  • json: Machine-readable JSON output
  • plain: Simple text, one item per line

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string
const (
	FormatTable Format = "table"
	FormatJSON  Format = "json"
	FormatPlain Format = "plain"
)

type Formatter

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

func New

func New(format string, color bool) *Formatter

New creates a new Formatter with the specified format and color support.

func (*Formatter) PrintCategories

func (f *Formatter) PrintCategories(categories []models.Category)

func (*Formatter) PrintChapters

func (f *Formatter) PrintChapters(chapters []models.Chapter)

func (*Formatter) PrintCuepoints

func (f *Formatter) PrintCuepoints(cuepoints []models.Cuepoint)

func (*Formatter) PrintDeviceStatistics

func (f *Formatter) PrintDeviceStatistics(stats []models.DeviceStatistics)

PrintDeviceStatistics prints device breakdown statistics.

func (*Formatter) PrintEpisode

func (f *Formatter) PrintEpisode(episode *models.Episode)

func (*Formatter) PrintEpisodeStatistics

func (f *Formatter) PrintEpisodeStatistics(stats *models.EpisodeOverallStatistics)

PrintEpisodeStatistics prints episode overall statistics.

func (*Formatter) PrintEpisodes

func (f *Formatter) PrintEpisodes(episodes []models.Episode)

func (*Formatter) PrintEpisodesPlayTotals

func (f *Formatter) PrintEpisodesPlayTotals(stats []models.EpisodePlayTotals)

PrintEpisodesPlayTotals prints play totals for each episode.

func (*Formatter) PrintError

func (f *Formatter) PrintError(err error)

func (*Formatter) PrintExploreShows

func (f *Formatter) PrintExploreShows(shows []models.ExploreShow)

PrintExploreShows prints a list of shows from explore endpoints.

func (*Formatter) PrintFollowersStatistics

func (f *Formatter) PrintFollowersStatistics(stats []models.FollowersStatistics)

PrintFollowersStatistics prints time-series followers statistics.

func (*Formatter) PrintGeographicStatistics

func (f *Formatter) PrintGeographicStatistics(stats *models.GeographicStatistics)

PrintGeographicStatistics prints geographic breakdown statistics.

func (*Formatter) PrintGooglePlayCategories

func (f *Formatter) PrintGooglePlayCategories(categories []models.GooglePlayCategory)

func (*Formatter) PrintKeyValue added in v1.2.1

func (f *Formatter) PrintKeyValue(pairs [][2]string)

PrintKeyValue renders a detail view with key-value pairs.

func (*Formatter) PrintLanguages

func (f *Formatter) PrintLanguages(languages []models.Language)

func (*Formatter) PrintLikesStatistics

func (f *Formatter) PrintLikesStatistics(stats []models.LikesStatistics)

PrintLikesStatistics prints time-series likes statistics.

func (*Formatter) PrintListenersStatistics

func (f *Formatter) PrintListenersStatistics(stats []models.ListenersStatistics)

PrintListenersStatistics prints time-series listeners statistics.

func (*Formatter) PrintMessage

func (f *Formatter) PrintMessage(msg string)

func (*Formatter) PrintMessages

func (f *Formatter) PrintMessages(messages []models.Message)

func (*Formatter) PrintOSStatistics

func (f *Formatter) PrintOSStatistics(stats *models.OSStatisticsBreakdown)

PrintOSStatistics prints operating system breakdown statistics.

func (*Formatter) PrintPlayStatistics

func (f *Formatter) PrintPlayStatistics(stats []models.PlayStatistics)

PrintPlayStatistics prints time-series play statistics.

func (*Formatter) PrintShow

func (f *Formatter) PrintShow(show *models.Show)

func (*Formatter) PrintShowStatistics

func (f *Formatter) PrintShowStatistics(stats *models.ShowOverallStatistics)

PrintShowStatistics prints show overall statistics.

func (*Formatter) PrintShows

func (f *Formatter) PrintShows(shows []models.Show)

func (*Formatter) PrintShowsPlayTotals

func (f *Formatter) PrintShowsPlayTotals(stats []models.ShowPlayTotals)

PrintShowsPlayTotals prints play totals for each show.

func (*Formatter) PrintSourcesStatistics

func (f *Formatter) PrintSourcesStatistics(stats *models.SourcesStatistics)

PrintSourcesStatistics prints sources breakdown statistics.

func (*Formatter) PrintStatistics

func (f *Formatter) PrintStatistics(stats *models.Statistics)

PrintStatistics prints overall statistics

func (*Formatter) PrintSuccess

func (f *Formatter) PrintSuccess(msg string)

func (*Formatter) PrintUser

func (f *Formatter) PrintUser(user *models.User)

func (*Formatter) PrintUserStatistics

func (f *Formatter) PrintUserStatistics(stats *models.UserOverallStatistics)

PrintUserStatistics prints user overall statistics.

func (*Formatter) PrintUsers

func (f *Formatter) PrintUsers(users []models.User)

func (*Formatter) PrintWarning added in v1.2.1

func (f *Formatter) PrintWarning(msg string)

func (*Formatter) StartProgressBar added in v1.2.1

func (f *Formatter) StartProgressBar(total int, title string) *pterm.ProgressbarPrinter

StartProgressBar starts a progress bar. Returns nil if color is disabled.

func (*Formatter) StartSpinner added in v1.2.1

func (f *Formatter) StartSpinner(msg string) *pterm.SpinnerPrinter

StartSpinner starts a spinner with the given message. Returns nil if color is disabled.

func (*Formatter) StopSpinner added in v1.2.1

func (f *Formatter) StopSpinner(spinner *pterm.SpinnerPrinter, success bool, msg string)

StopSpinner stops a spinner with a success or failure message.

Jump to

Keyboard shortcuts

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