output

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInteractive

func IsInteractive(flagMode string) bool

func PrintCSV

func PrintCSV(data interface{}) error

PrintCSV prints a slice of structs as CSV by first converting to []map[string]interface{} via JSON round-trip, then using the first record's keys as headers.

func PrintError

func PrintError(err error, exitCode int)

func PrintJSON

func PrintJSON(command, athleteID string, filters map[string]string, data interface{}) error

Types

type Meta

type Meta struct {
	Command   string            `json:"command"`
	AthleteID string            `json:"athlete_id"`
	Timestamp string            `json:"timestamp"`
	Count     int               `json:"count,omitempty"`
	Filters   map[string]string `json:"filters,omitempty"`
}

type Mode

type Mode string
const (
	ModeAuto  Mode = "auto"
	ModeTable Mode = "table"
	ModeJSON  Mode = "json"
	ModeCSV   Mode = "csv"
)

type Response

type Response struct {
	Meta Meta        `json:"meta"`
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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