output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package output formats nvfleetctl command responses.

Index

Constants

View Source
const (
	FormatTable = "table"
	FormatJSON  = "json"
)

Variables

This section is empty.

Functions

func DisplayString

func DisplayString(value string) string

Returns a printable placeholder for empty strings

func FormatGeoLocation

func FormatGeoLocation(location *fleetintelligence.GeoLocation) string

Formats the most useful location label available

func FormatNameAndID

func FormatNameAndID(name, id string) string

Formats a display name with its stable identifier

func FormatNameOrID

func FormatNameOrID(name, id string) string

Returns the display name when present or the ID otherwise

func FormatOptionalInt

func FormatOptionalInt(value *int) string

Formats optional integers for table output

func FormatOptionalPercentage

func FormatOptionalPercentage(value *float32) string

Formats optional percentage values for table output

func FormatStringList

func FormatStringList(values []string) string

Formats non-empty strings as a comma-separated list

func IsValidFormat

func IsValidFormat(format string) bool

Reports whether format is a supported output format

func WriteJSON

func WriteJSON(w io.Writer, value any) error

Writes value as a single JSON document

func WritePaginationFooter

func WritePaginationFooter(w io.Writer, page Pagination) error

Writes the standard single-page pagination footer

func WriteRawJSON

func WriteRawJSON(w io.Writer, data []byte) error

Writes a raw JSON payload with a trailing newline

func WriteTable

func WriteTable(w io.Writer, headers []string, rows [][]string) error

Writes headers and rows as tab-aligned text

Types

type Pagination

type Pagination struct {
	Page     int
	PageSize int
	Total    int
	HasMore  bool
}

Represents pagination metadata for table footers

Jump to

Keyboard shortcuts

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