Documentation
¶
Overview ¶
Package output formats nvfleetctl command responses.
Index ¶
- Constants
- func DisplayString(value string) string
- func FormatGeoLocation(location *fleetintelligence.GeoLocation) string
- func FormatNameAndID(name, id string) string
- func FormatNameOrID(name, id string) string
- func FormatOptionalInt(value *int) string
- func FormatOptionalPercentage(value *float32) string
- func FormatStringList(values []string) string
- func IsValidFormat(format string) bool
- func WriteJSON(w io.Writer, value any) error
- func WritePaginationFooter(w io.Writer, page Pagination) error
- func WriteRawJSON(w io.Writer, data []byte) error
- func WriteTable(w io.Writer, headers []string, rows [][]string) error
- type Pagination
Constants ¶
View Source
const ( FormatTable = "table" FormatJSON = "json" )
Variables ¶
This section is empty.
Functions ¶
func DisplayString ¶
Returns a printable placeholder for empty strings
func FormatGeoLocation ¶
func FormatGeoLocation(location *fleetintelligence.GeoLocation) string
Formats the most useful location label available
func FormatNameAndID ¶
Formats a display name with its stable identifier
func FormatNameOrID ¶
Returns the display name when present or the ID otherwise
func FormatOptionalInt ¶
Formats optional integers for table output
func FormatOptionalPercentage ¶
Formats optional percentage values for table output
func FormatStringList ¶
Formats non-empty strings as a comma-separated list
func IsValidFormat ¶
Reports whether format is a supported output format
func WritePaginationFooter ¶
func WritePaginationFooter(w io.Writer, page Pagination) error
Writes the standard single-page pagination footer
func WriteRawJSON ¶
Writes a raw JSON payload with a trailing newline
Types ¶
Click to show internal directories.
Click to hide internal directories.