Documentation ¶
Index ¶
- Constants
- func ColsMessage(cols []string) string
- func GetHeaders(allColumns []string, defaultColumns []string, customColumns []string) []string
- func GetHeadersAllDefault(allColumns []string, customColumns []string) []string
- func GetHeadersListAll(allColumns []string, defaultColumns []string, parentCol string, ...) []string
- func GetId(r *resources.Response) string
- func GetRequestId(path string) (string, error)
- func GetRequestPath(r *resources.Response) string
- func WriteJSON(item interface{}, writer io.Writer) error
- type JSONPrinter
- func (p *JSONPrinter) GetStderr() io.Writer
- func (p *JSONPrinter) GetStdout() io.Writer
- func (p *JSONPrinter) Print(v interface{}) error
- func (p *JSONPrinter) SetStderr(writer io.Writer)
- func (p *JSONPrinter) SetStdout(writer io.Writer)
- func (p *JSONPrinter) Verbose(format string, a ...interface{})
- func (p *JSONPrinter) Warn(v interface{}) error
- type PrintService
- type Registry
- type Result
- type ResultPrint
- type TextPrinter
- func (p *TextPrinter) GetStderr() io.Writer
- func (p *TextPrinter) GetStdout() io.Writer
- func (p *TextPrinter) Print(v interface{}) error
- func (p *TextPrinter) SetStderr(writer io.Writer)
- func (p *TextPrinter) SetStdout(writer io.Writer)
- func (p *TextPrinter) Verbose(format string, a ...interface{})
- func (p *TextPrinter) Warn(v interface{}) error
- type ToPrint
- type Type
Constants ¶
View Source
const ( // TypeJSON defines a JSON formatter. TypeJSON = Type("json") // TypeText defines a human-readable formatted formatter. TypeText = Type("text") )
Variables ¶
This section is empty.
Functions ¶
func ColsMessage ¶
func GetHeaders ¶
GetHeaders takes all columns of a resource and the value of the columns flag, returns the headers of the table. (Some legacy code might refer to these headers as "Columns") allColumns can be found by using structs.Names on a Print struct (i.e. structs.Names(DatacenterPrint{}))
func GetHeadersAllDefault ¶
GetHeadersAllDefault is like GetHeaders, but defaultColumns is same as allColumns. Useful for resources with small print table
func GetHeadersListAll ¶
func GetRequestId ¶
func GetRequestPath ¶
Types ¶
type JSONPrinter ¶
func (*JSONPrinter) GetStderr ¶
func (p *JSONPrinter) GetStderr() io.Writer
func (*JSONPrinter) GetStdout ¶
func (p *JSONPrinter) GetStdout() io.Writer
func (*JSONPrinter) Print ¶
func (p *JSONPrinter) Print(v interface{}) error
func (*JSONPrinter) SetStderr ¶
func (p *JSONPrinter) SetStderr(writer io.Writer)
func (*JSONPrinter) SetStdout ¶
func (p *JSONPrinter) SetStdout(writer io.Writer)
func (*JSONPrinter) Verbose ¶
func (p *JSONPrinter) Verbose(format string, a ...interface{})
func (*JSONPrinter) Warn ¶
func (p *JSONPrinter) Warn(v interface{}) error
type PrintService ¶
type Registry ¶
type Registry map[string]PrintService
type Result ¶
type ResultPrint ¶
type ResultPrint struct { Message interface{} `json:"Status,omitempty"` RequestId interface{} `json:"RequestId,omitempty"` Output interface{} `json:"items,omitempty"` }
type TextPrinter ¶
func (*TextPrinter) GetStderr ¶
func (p *TextPrinter) GetStderr() io.Writer
func (*TextPrinter) GetStdout ¶
func (p *TextPrinter) GetStdout() io.Writer
func (*TextPrinter) Print ¶
func (p *TextPrinter) Print(v interface{}) error
func (*TextPrinter) SetStderr ¶
func (p *TextPrinter) SetStderr(writer io.Writer)
func (*TextPrinter) SetStdout ¶
func (p *TextPrinter) SetStdout(writer io.Writer)
func (*TextPrinter) Verbose ¶
func (p *TextPrinter) Verbose(format string, a ...interface{})
func (*TextPrinter) Warn ¶
func (p *TextPrinter) Warn(v interface{}) error
Click to show internal directories.
Click to hide internal directories.