Help us shape the future of Go! Take the 2026 Go Developer Survey

output

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package output renders Strava data as human-readable tables or JSON.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDistance

func FormatDistance(meters float32) string

FormatDistance converts meters to a human-readable string (exported for tests).

func FormatDuration

func FormatDuration(seconds int) string

FormatDuration converts seconds to a human-readable string (exported for tests).

func FormatTime

func FormatTime(t *time.Time) string

FormatTime exports the time formatter for use in tests.

Types

type Printer

type Printer struct {
	JSON bool
	// contains filtered or unexported fields
}

Printer writes formatted output to a writer.

func New

func New(w io.Writer, jsonMode bool) *Printer

New creates a Printer that writes to w.

func (*Printer) Activities

Activities prints a list of summary activities.

func (*Printer) Activity

func (p *Printer) Activity(a *client.GetActivityByIdResponse) error

Activity prints a single detailed activity.

func (*Printer) ActivityZones

func (p *Printer) ActivityZones(r *client.GetZonesByActivityIdResponse) error

ActivityZones prints HR/power zones for an activity.

func (*Printer) Athlete

Athlete prints the authenticated athlete.

func (*Printer) AthleteZones

AthleteZones prints the authenticated athlete's HR and power zones.

func (*Printer) Club

Club prints a single club's detail.

func (*Printer) ClubActivities

func (p *Printer) ClubActivities(r *client.GetClubActivitiesByIdResponse) error

ClubActivities prints recent activities from a club. Note: the API only returns athlete ID (not name) for privacy reasons.

func (*Printer) ClubMembers

func (p *Printer) ClubMembers(r *client.GetClubMembersByIdResponse) error

ClubMembers prints the members of a club.

func (*Printer) Clubs

Clubs prints the list of clubs the athlete belongs to.

func (*Printer) Comments

Comments prints comments on an activity.

func (*Printer) ExploreSegments

func (p *Printer) ExploreSegments(r *client.ExploreSegmentsResponse) error

ExploreSegments prints explored segments.

func (*Printer) Gear

Gear prints gear detail.

func (*Printer) Kudos

Kudos prints athletes who kudoed an activity.

func (*Printer) Laps

Laps prints laps for an activity.

func (*Printer) Route

Route prints a single route's detail.

func (*Printer) Routes

Routes prints a list of routes.

func (*Printer) Segment

func (p *Printer) Segment(r *client.GetSegmentByIdResponse) error

Segment prints a segment's detail.

func (*Printer) SegmentEffort

func (p *Printer) SegmentEffort(r *client.GetSegmentEffortByIdResponse) error

SegmentEffort prints a single segment effort.

func (*Printer) SegmentEfforts

func (p *Printer) SegmentEfforts(r *client.GetEffortsBySegmentIdResponse) error

SegmentEfforts prints a list of efforts on a segment.

func (*Printer) StarredSegments

StarredSegments prints the list of starred segments.

func (*Printer) Stats

func (p *Printer) Stats(r *client.GetStatsResponse) error

Stats prints athlete lifetime and recent statistics.

func (*Printer) Streams

Streams prints activity stream data. In human mode it shows a summary table; use --json for the full data.

Jump to

Keyboard shortcuts

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