Documentation ¶
Overview ¶
Package utils handles fancy utilities
Index ¶
- func BytesToReadable(bytes int64) string
- func Error(message string, args ...interface{}) error
- func ErrorExit(cmd *cobra.Command, message string, args ...interface{}) error
- func GofishClient(connection string) (*gofish.APIClient, error)
- func RenderTable(rawJSON []byte, rows [][]string)
- func RenderTableList(rawJSON []byte, columns []string, sortColumn string)
- type TableOutputWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToReadable ¶
BytesToReadable formats a byte count into a human readable representation.
func GofishClient ¶
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.
func RenderTable ¶
RenderTable will print out data from the json passed in and the rows that we want printed
func RenderTableList ¶
RenderTableList will print out a table based on the json and json selectors passed in
Types ¶
type TableOutputWriter ¶
type TableOutputWriter interface { SetHeaders(headers ...string) AddRow(items ...interface{}) Render() RowCount() int }
TableOutputWriter is the interface to write out tables
func NewTableWriter ¶
func NewTableWriter(output io.Writer, headers ...string) TableOutputWriter
NewTableWriter gets a new instance of our table output writer.
Click to show internal directories.
Click to hide internal directories.