utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause

SPDX-License-Identifier: BSD-3-Clause

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToReadable

func BytesToReadable(bytes int64) string

BytesToReadable formats a byte count into a human readable representation.

func Error

func Error(message string, args ...interface{}) error

Error is a helper function to format the error results.

func ErrorExit

func ErrorExit(cmd *cobra.Command, message string, args ...interface{}) error

ErrorExit is a helper function to format the error result of a command execution.

func GofishClient

func GofishClient(connection string) (*gofish.APIClient, error)

GofishClient will get a gofish client connection for the requested system. If connection == "", then the default system will be retrieved. The caller should close the client connection when done.

Types

type TableOutputWriter

type TableOutputWriter interface {
	SetHeaders(headers ...string)
	AddRow(items ...interface{})
	Render()
	RowCount() int
}

func NewTableWriter

func NewTableWriter(output io.Writer, headers ...string) TableOutputWriter

NewTableWriter gets a new instance of our table output writer.

Jump to

Keyboard shortcuts

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