Documentation
¶
Index ¶
- Constants
- Variables
- func ColorNameValues() []string
- func Contains(arr []string, str string) bool
- func GetColor(optionName string, colorNames []string) (*color.Color, error)
- func GetFilePath(r *http.Request) string
- func GetRootPath() string
- func HandleError(w http.ResponseWriter, e error)
- func HomeDir() string
- func InvalidArg(value string, values []string) error
- func InvalidArgError(value string, err error) error
- func InvalidArgf(value string, message string, a ...interface{}) error
- func InvalidOption(name string, value string, values []string) error
- func InvalidOptionError(option string, value interface{}, err error) error
- func InvalidOptionf(option string, value interface{}, message string, a ...interface{}) error
- func LoadTemplate(w http.ResponseWriter, temp templates.Template, content interface{})
- func Log(level LogLevel, messages ...interface{})
- func Logger() *logrus.Entry
- func MissingArgument(name string) error
- func MissingEnv(name string) error
- func MissingOption(name string) error
- func MissingOptionWithOptions(name string, options []string) error
- func SuggestionsFor(typedName string, values []string, suggestionsMinimumDistance int, ...) []string
- type FormatLayoutType
- type LogLevel
- type TextFormat
- type UnsupportedError
Constants ¶
const ( DEBUG LogLevel = 0 INFO LogLevel = 1 WARN LogLevel = 2 ERROR LogLevel = 3 FormatLayoutJSON FormatLayoutType = "json" FormatLayoutText FormatLayoutType = "text" FormatLayoutStackdriver FormatLayoutType = "stackdriver" )
const (
DefaultSuggestionsMinimumDistance = 2
)
Variables ¶
var ColorAnswer = color.New(color.FgCyan).SprintFunc()
ColorAnswer returns a new function that returns answer-colorized (cyan) strings for the given arguments with fmt.Sprint().
var ColorBold = color.New(color.Bold).SprintFunc()
ColorBold returns a new function that returns bold-colorized (bold) strings for the given arguments with fmt.Sprint().
var ColorDebug = color.New(color.FgCyan).SprintFunc()
var ColorError = color.New(color.FgRed).SprintFunc()
ColorError returns a new function that returns error-colorized (red) strings for the given arguments with fmt.Sprint().
var ColorInfo = color.New(color.FgGreen).SprintFunc()
ColorInfo returns a new function that returns info-colorized (green) strings for the given arguments with fmt.Sprint().
var ColorStatus = color.New(color.FgBlue).SprintFunc()
ColorStatus returns a new function that returns status-colorized (blue) strings for the given arguments with fmt.Sprint().
var ColorWarning = color.New(color.FgYellow).SprintFunc()
ColorWarning returns a new function that returns warning-colorized (yellow) strings for the given arguments with fmt.Sprint().
var Version string
set at build time
Functions ¶
func ColorNameValues ¶
func ColorNameValues() []string
ColorNameValues returns all the color names sorted
func GetFilePath ¶
func GetRootPath ¶
func GetRootPath() string
func HandleError ¶
func HandleError(w http.ResponseWriter, e error)
func InvalidArg ¶
func InvalidArgError ¶
func InvalidArgf ¶
func InvalidOptionError ¶
InvalidOptionError returns an error that shows the invalid option
func InvalidOptionf ¶
InvalidOptionf returns an error that shows the invalid option
func LoadTemplate ¶
func LoadTemplate(w http.ResponseWriter, temp templates.Template, content interface{})
func MissingArgument ¶
MissingArgument reports a missing command line argument name
func MissingEnv ¶
MissingEnv reports a missing environment variable
func MissingOption ¶
MissingOption reports a missing command line option using the full name expression
func MissingOptionWithOptions ¶
MissingOptionWithOptions reports a missing command line option using the full name expression along with a list of available values
Types ¶
type FormatLayoutType ¶
type FormatLayoutType string
type TextFormat ¶
JenkinsXTextFormat lets use a custom text format
func NewTextFormat ¶
func NewTextFormat() *TextFormat
NewTextFormat creates the default text formatter
type UnsupportedError ¶
type UnsupportedError struct{}
func (UnsupportedError) Error ¶
func (e UnsupportedError) Error() string