pretty

package
v0.0.0-...-72cc25f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-2-Clause-Patent Imports: 18 Imported by: 0

Documentation

Overview

Package pretty provides pretty-printers for complex response types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintCheckQueryResp

func PrintCheckQueryResp(out io.Writer, resp *control.SystemCheckQueryResp, verbose bool)

PrintCheckQueryResp prints the checker results to the console.

func PrintCheckerPolicies

func PrintCheckerPolicies(out io.Writer, flags control.SystemCheckFlags, policies ...*control.SystemCheckPolicy)

PrintCheckerPolicies displays a two-column table of checker policy classes and actions.

func PrintHostErrorsMap

func PrintHostErrorsMap(hem control.HostErrorsMap, out io.Writer, opts ...PrintConfigOption) error

PrintHostErrorsMap generates a human-readable representation of the supplied HostErrorsMap struct and writes it to the supplied io.Writer.

func PrintHostFabricMap

func PrintHostFabricMap(hfm control.HostFabricMap, out io.Writer, opts ...PrintConfigOption) error

PrintHostFabricMap generates a human-readable representation of the supplied HostFabricMap and writes it to the supplied io.Writer.

func PrintHostStorageMap

func PrintHostStorageMap(hsm control.HostStorageMap, out io.Writer, opts ...PrintConfigOption) error

PrintHostStorageMap generates a human-readable representation of the supplied HostStorageMap struct and writes it to the supplied io.Writer.

func PrintHostStorageUsageMap

func PrintHostStorageUsageMap(hsm control.HostStorageMap, out io.Writer) error

PrintHostStorageUsageMap generates a human-readable representation of the supplied HostStorageMap struct and writes utilization info to the supplied io.Writer.

func PrintListPoolsResponse

func PrintListPoolsResponse(out, outErr io.Writer, resp *control.ListPoolsResp, verbose bool, noQuery bool) error

PrintListPoolsResponse generates a human-readable representation of the supplied ListPoolsResp struct and writes it to the supplied io.Writer. Additional columns for pool UUID and service replicas if verbose is set.

func PrintMetricsListResp

func PrintMetricsListResp(out io.Writer, resp *control.MetricsListResp) error

PrintMetricsListResp formats the MetricsListResp as a table of available metric sets with the name, type, and description for each.

func PrintMetricsQueryResp

func PrintMetricsQueryResp(out io.Writer, resp *control.MetricsQueryResp) error

PrintMetricsQueryResp formats a MetricsQueryResp as a list of metric sets. For each metric set, it includes a table of metrics in the set, detailing the identifying information and value for each.

func PrintNVMeFirmwareQueryMap

func PrintNVMeFirmwareQueryMap(fwMap control.HostNVMeQueryMap, out io.Writer,
	opts ...PrintConfigOption) error

PrintNVMeFirmwareQueryMap formats the NVMe device firmware query results in a concise format.

func PrintNVMeFirmwareQueryMapVerbose

func PrintNVMeFirmwareQueryMapVerbose(fwMap control.HostNVMeQueryMap, out io.Writer,
	opts ...PrintConfigOption) error

PrintNVMeFirmwareQueryMapVerbose formats the NVMe device firmware query results in a verbose format.

func PrintNVMeFirmwareUpdateMap

func PrintNVMeFirmwareUpdateMap(fwMap control.HostNVMeUpdateMap, out io.Writer,
	opts ...PrintConfigOption) error

PrintNVMeFirmwareUpdateMap formats the NVMe device firmware update results in a concise format.

func PrintNVMeFirmwareUpdateMapVerbose

func PrintNVMeFirmwareUpdateMapVerbose(fwMap control.HostNVMeUpdateMap, out io.Writer, opts ...PrintConfigOption) error

PrintNVMeFirmwareUpdateMapVerbose prints a verbose listing of firmware update results.

func PrintNvmeControllers

func PrintNvmeControllers(controllers storage.NvmeControllers, out io.Writer, opts ...PrintConfigOption) error

PrintNvmeControllers displays controller details in a verbose table.

func PrintNvmeHealthMap

func PrintNvmeHealthMap(hsm control.HostStorageMap, out io.Writer, opts ...PrintConfigOption) error

PrintNvmeHealthMap generates a human-readable representation of the supplied HostStorageMap, with a focus on presenting the NVMe Device Health information.

func PrintPoolCreateResponse

func PrintPoolCreateResponse(pcr *control.PoolCreateResp, out io.Writer, opts ...PrintConfigOption) error

PrintPoolCreateResponse generates a human-readable representation of the pool create response and prints it to the supplied io.Writer.

func PrintPoolProperties

func PrintPoolProperties(poolID string, out io.Writer, properties ...*daos.PoolProperty)

PrintPoolProperties displays a two-column table of pool property names and values.

func PrintPoolQueryResponse

func PrintPoolQueryResponse(pqr *control.PoolQueryResp, out io.Writer, opts ...PrintConfigOption) error

PrintPoolQueryResponse generates a human-readable representation of the supplied PoolQueryResp struct and writes it to the supplied io.Writer.

func PrintPoolQueryTargetResponse

func PrintPoolQueryTargetResponse(pqtr *control.PoolQueryTargetResp, out io.Writer, opts ...PrintConfigOption) error

PrintPoolQueryTargetResponse generates a human-readable representation of the supplied PoolQueryTargetResp struct and writes it to the supplied io.Writer.

func PrintResponseErrors

func PrintResponseErrors(resp hostErrorsGetter, out io.Writer, opts ...PrintConfigOption) error

func PrintSCMFirmwareQueryMap

func PrintSCMFirmwareQueryMap(fwMap control.HostSCMQueryMap, out io.Writer,
	opts ...PrintConfigOption) error

PrintSCMFirmwareQueryMap formats the firmware query results in a condensed format.

func PrintSCMFirmwareQueryMapVerbose

func PrintSCMFirmwareQueryMapVerbose(fwMap control.HostSCMQueryMap, out io.Writer,
	opts ...PrintConfigOption) error

PrintSCMFirmwareQueryMapVerbose formats the firmware query results in a detailed format.

func PrintSCMFirmwareUpdateMap

func PrintSCMFirmwareUpdateMap(fwMap control.HostSCMUpdateMap, out io.Writer,
	opts ...PrintConfigOption) error

PrintSCMFirmwareUpdateMap prints the update results in a condensed format.

func PrintSCMFirmwareUpdateMapVerbose

func PrintSCMFirmwareUpdateMapVerbose(fwMap control.HostSCMUpdateMap, out io.Writer,
	opts ...PrintConfigOption) error

PrintSCMFirmwareUpdateMapVerbose formats the firmware update results in a detailed format.

func PrintScmModules

func PrintScmModules(modules storage.ScmModules, out io.Writer, opts ...PrintConfigOption) error

PrintScmModules displays PMem module details in a verbose table.

TODO: un-export function when not needed in cmd/daos_server/storage.go

func PrintScmNamespaces

func PrintScmNamespaces(namespaces storage.ScmNamespaces, out io.Writer, opts ...PrintConfigOption) error

PrintScmNamespaces displays pmem block device details in a verbose table.

TODO: un-export function when not needed in cmd/daos_server/storage.go

func PrintSetEngineLogMasksResp

func PrintSetEngineLogMasksResp(resp *control.SetEngineLogMasksResp, out, outErr io.Writer) error

PrintSetEngineLogMasksResp generates a human-readable representation of the supplied response.

func PrintSmdInfoMap

func PrintSmdInfoMap(omitDevs, omitPools bool, hsm control.HostStorageMap, out io.Writer, opts ...PrintConfigOption) error

PrintSmdInfoMap generates a human-readable representation of the supplied HostStorageMap, with a focus on presenting the per-server metadata (SMD) information.

func PrintStorageFormatMap

func PrintStorageFormatMap(hsm control.HostStorageMap, out io.Writer, opts ...PrintConfigOption) error

PrintStorageFormatMap generates a human-readable representation of the supplied HostStorageMap which is populated in response to a StorageFormat operation.

func PrintSystemCleanupResponse

func PrintSystemCleanupResponse(out, outErr io.Writer, resp *control.SystemCleanupResp, verbose bool) error

PrintSystemCleanupResponse generates a human-readable representation of the supplied SystemCleanupResp struct and writes it to the supplied io.Writer.

func PrintSystemQueryResponse

func PrintSystemQueryResponse(out, outErr io.Writer, resp *control.SystemQueryResp, opts ...PrintConfigOption) error

PrintSystemQueryResponse generates a human-readable representation of the supplied SystemQueryResp struct and writes it to the supplied io.Writer.

func PrintSystemStartResponse

func PrintSystemStartResponse(out, outErr io.Writer, resp *control.SystemStartResp) error

PrintSystemStartResponse generates a human-readable representation of the supplied SystemStartResp struct and writes it to the supplied io.Writer.

func PrintSystemStopResponse

func PrintSystemStopResponse(out, outErr io.Writer, resp *control.SystemStopResp) error

PrintSystemStopResponse generates a human-readable representation of the supplied SystemStopResp struct and writes it to the supplied io.Writer.

func PrintTierRatio

func PrintTierRatio(ratio float64) string

PrintTierRatio generates a human-readable representation of the supplied tier ratio.

func UpdateErrorSummary

func UpdateErrorSummary(resp hostErrorsGetter, cmd string, out io.Writer, opts ...PrintConfigOption) error

PrintErrorsSummary generates a human-readable representation of the supplied HostErrorsMap summary struct and writes it to the supplied io.Writer.

Types

type PrintConfig

type PrintConfig struct {
	// Verbose indicates that the output should include more detail.
	Verbose bool
	// ShowHostPorts indicates that the host output should include the network port.
	ShowHostPorts bool
	// LEDInfoOnly indicates that the output should only include LED related info.
	LEDInfoOnly bool
}

PrintConfig defines parameters for controlling formatter behavior.

type PrintConfigOption

type PrintConfigOption func(*PrintConfig)

PrintConfigOption defines a config function.

func PrintOnlyLEDInfo

func PrintOnlyLEDInfo() PrintConfigOption

PrintOnlyLEDInfo enables display of details relevant to LED state in output.

func PrintWithHostPorts

func PrintWithHostPorts() PrintConfigOption

PrintWithHostPorts enables display of host ports in output.

func PrintWithVerboseOutput

func PrintWithVerboseOutput(verbose bool) PrintConfigOption

PrintWithVerboseOutput toggles verbose output from the formatter.

Jump to

Keyboard shortcuts

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