Documentation ¶
Index ¶
- func MarshalToJson(input interface{}) ([]byte, error)
- func MarshalToYaml(input interface{}) ([]byte, error)
- type ColorizeUi
- func (u *ColorizeUi) Ask(query string) (string, error)
- func (u *ColorizeUi) AskSecret(query string) (string, error)
- func (u *ColorizeUi) Error(message string)
- func (u *ColorizeUi) Info(message string)
- func (u *ColorizeUi) JsonOutput(data interface{})
- func (u *ColorizeUi) Output(message string)
- func (u *ColorizeUi) Success(message string)
- func (u *ColorizeUi) Warn(message string)
- type OutputFormater
- type Ui
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalToJson ¶ added in v1.22.1
func MarshalToYaml ¶ added in v1.22.1
Types ¶
type ColorizeUi ¶ added in v1.22.1
type ColorizeUi struct { Colorize *colorstring.Colorize OutputColor string InfoColor string ErrorColor string WarnColor string SuccessColor string Ui cli.Ui Quiet bool OutputFormater OutputFormater }
func NewUI ¶ added in v1.22.1
func NewUI( quiet, color bool, outputFormater OutputFormater, outWriter, errWriter io.Writer, ) *ColorizeUi
func (*ColorizeUi) AskSecret ¶ added in v1.22.1
func (u *ColorizeUi) AskSecret(query string) (string, error)
func (*ColorizeUi) Error ¶ added in v1.22.1
func (u *ColorizeUi) Error(message string)
func (*ColorizeUi) Info ¶ added in v1.22.1
func (u *ColorizeUi) Info(message string)
func (*ColorizeUi) JsonOutput ¶ added in v1.22.1
func (u *ColorizeUi) JsonOutput(data interface{})
JsonOutput prints the data specified using the configured OutputFormater.
func (*ColorizeUi) Output ¶ added in v1.22.1
func (u *ColorizeUi) Output(message string)
func (*ColorizeUi) Success ¶ added in v1.22.1
func (u *ColorizeUi) Success(message string)
func (*ColorizeUi) Warn ¶ added in v1.22.1
func (u *ColorizeUi) Warn(message string)
type OutputFormater ¶ added in v1.22.1
func MarshalToJsonPathWrapper ¶ added in v1.22.1
func MarshalToJsonPathWrapper(expression string) OutputFormater
MarshalToJsonPathWrapper returns a MarshalToJsonPath function that uses the specified jsonpath expression. This leverages the kubernetes jsonpath library (https://kubernetes.io/docs/reference/kubectl/jsonpath/).
func ParseOutputFormat ¶
func ParseOutputFormat(outputFormat string) (OutputFormater, error)
ParseOutputFormat returns an OutputFormater based on the specified format. Accepted values include 'json', 'yaml', and 'jsonpath=PATH'. Empty string defaults to 'json'. For more about JSONPath, see https://goessner.net/articles/JsonPath/
Click to show internal directories.
Click to hide internal directories.