table

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package table provides common table formatting utilities for CLI commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAuthorsString

func BuildAuthorsString(authors []catalogs.Author) string

BuildAuthorsString creates a comma-separated list of author names.

func BuildFeaturesString

func BuildFeaturesString(model catalogs.Model) string

BuildFeaturesString creates a comma-separated list of model features.

func FormatNumber

func FormatNumber(n int64) string

FormatNumber formats large numbers with comma separators.

func FormatOutput

func FormatOutput(limits *catalogs.ModelLimits) string

FormatOutput formats output token limit information.

func FormatPrice

func FormatPrice(pricing *catalogs.ModelPricing, input bool) string

FormatPrice formats pricing information.

func FormatTokens

func FormatTokens(limits *catalogs.ModelLimits) string

FormatTokens formats context window information.

Types

type Data

type Data struct {
	Headers []string
	Rows    [][]string
}

Data represents table formatting data to avoid import cycles.

func AuthorsToTableData

func AuthorsToTableData(authors []catalogs.Author) Data

AuthorsToTableData converts authors to table format.

func ModelsToTableData

func ModelsToTableData(models []catalogs.Model, showDetails bool) Data

ModelsToTableData converts models to table format.

func ProvidersToTableData

func ProvidersToTableData(providers []catalogs.Provider, showKeys bool) Data

ProvidersToTableData converts providers to table format.

Jump to

Keyboard shortcuts

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