Documentation
¶
Index ¶
Constants ¶
View Source
const ( OutputFormatJson = "json" OutputFormatText = "text" FlagDebug = "debug" FlagOutputFormat = "output-format" )
Variables ¶
View Source
var ( ErrParse = ErrorFactory(1)("parse-error") ErrApi = ErrorFactory(2)("api-error") ErrOp = ErrorFactory(3)("op-error") ErrDependency = ErrorFactory(4)("dependency-error") )
Functions ¶
func ErrorFactory ¶
func HandledJson ¶
func HandledJson(raw []byte, err error) func(f CombinedJsonOutputHandler) (interface{}, error)
Types ¶
type ExtraArgs ¶
func (*ExtraArgs) InjectExtraArgs ¶
type JsonHandler ¶
type JsonHandler func(raw []byte, err error) OutputProcessor
func HandleOutput ¶
func HandleOutput(printer MessagePrinter) JsonHandler
type MessagePrinter ¶
type MessagePrinter interface {
Info(templateText string, args map[string]interface{})
Debug(templateText string, args map[string]interface{})
Fatal(exitCode int, templateText string, args map[string]interface{})
}
func WithConfig ¶
func WithConfig(cmd *cobra.Command, opt *ExtraArgs) MessagePrinter
type OutputProcessor ¶
type OutputProcessor func(CombinedJsonOutputHandler) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.