Documentation ¶
Overview ¶
Package pretty provides pretty-printers for complex response types.
Index ¶
- func PrintCheckQueryResp(out io.Writer, resp *control.SystemCheckQueryResp, verbose bool)
- func PrintCheckerPolicies(out io.Writer, flags control.SystemCheckFlags, ...)
- func PrintHostErrorsMap(hem control.HostErrorsMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintHostFabricMap(hfm control.HostFabricMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintHostStorageMap(hsm control.HostStorageMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintHostStorageSuccesses(desc string, hsm control.HostStorageMap, out io.Writer) error
- func PrintHostStorageUsageMap(hsm control.HostStorageMap, out io.Writer) error
- func PrintListPoolsResponse(out, outErr io.Writer, resp *control.ListPoolsResp, verbose bool, noQuery bool) error
- func PrintMetricsListResp(out io.Writer, resp *control.MetricsListResp) error
- func PrintMetricsQueryResp(out io.Writer, resp *control.MetricsQueryResp) error
- func PrintNVMeFirmwareQueryMap(fwMap control.HostNVMeQueryMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintNVMeFirmwareQueryMapVerbose(fwMap control.HostNVMeQueryMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintNVMeFirmwareUpdateMap(fwMap control.HostNVMeUpdateMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintNVMeFirmwareUpdateMapVerbose(fwMap control.HostNVMeUpdateMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintNvmeControllers(controllers storage.NvmeControllers, out io.Writer, opts ...PrintConfigOption) error
- func PrintNvmeHealthMap(hsm control.HostStorageMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintPoolCreateResponse(pcr *control.PoolCreateResp, out io.Writer, opts ...PrintConfigOption) error
- func PrintPoolProperties(poolID string, out io.Writer, properties ...*daos.PoolProperty)
- func PrintPoolQueryResponse(pqr *control.PoolQueryResp, out io.Writer, opts ...PrintConfigOption) error
- func PrintPoolQueryTargetResponse(pqtr *control.PoolQueryTargetResp, out io.Writer, opts ...PrintConfigOption) error
- func PrintResponseErrors(resp hostErrorsGetter, out io.Writer, opts ...PrintConfigOption) error
- func PrintSCMFirmwareQueryMap(fwMap control.HostSCMQueryMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintSCMFirmwareQueryMapVerbose(fwMap control.HostSCMQueryMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintSCMFirmwareUpdateMap(fwMap control.HostSCMUpdateMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintSCMFirmwareUpdateMapVerbose(fwMap control.HostSCMUpdateMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintScmModules(modules storage.ScmModules, out io.Writer, opts ...PrintConfigOption) error
- func PrintScmNamespaces(namespaces storage.ScmNamespaces, out io.Writer, opts ...PrintConfigOption) error
- func PrintSetEngineLogMasksResp(resp *control.SetEngineLogMasksResp, out, outErr io.Writer) error
- func PrintSmdInfoMap(omitDevs, omitPools bool, hsm control.HostStorageMap, out io.Writer, ...) error
- func PrintSmdManageResp(op control.SmdManageOpcode, resp *control.SmdResp, out, outErr io.Writer, ...) error
- func PrintStorageFormatMap(hsm control.HostStorageMap, out io.Writer, opts ...PrintConfigOption) error
- func PrintSystemCleanupResponse(out, outErr io.Writer, resp *control.SystemCleanupResp, verbose bool) error
- func PrintSystemQueryResponse(out, outErr io.Writer, resp *control.SystemQueryResp, ...) error
- func PrintSystemStartResponse(out, outErr io.Writer, resp *control.SystemStartResp) error
- func PrintSystemStopResponse(out, outErr io.Writer, resp *control.SystemStopResp) error
- func PrintTierRatio(ratio float64) string
- func UpdateErrorSummary(resp hostErrorsGetter, cmd string, out io.Writer, opts ...PrintConfigOption) error
- type PrintConfig
- type PrintConfigOption
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 PrintHostStorageSuccesses ¶
PrintHostStorageSuccess displays a success message for the host set that completed the operation successfully. To be used to print responses that are expected to contain one or zero successful host sets.
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 PrintSmdManageResp ¶
func PrintSmdManageResp(op control.SmdManageOpcode, resp *control.SmdResp, out, outErr io.Writer, opts ...PrintConfigOption) error
PrintSmdManageResp generates a human-readable representation of the supplied response.
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 ¶
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.