cliutils

package
v0.0.0-...-152d858 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// General CLI constants
	CliVersion           = "1.20.2"
	ClientAgent          = "jfrog-cli-go"
	OnErrorPanic OnError = "panic"

	// CLI base commands constants:
	CmdArtifactory    = "rt"
	CmdBintray        = "bt"
	CmdMissionControl = "mc"
	CmdXray           = "xr"

	// Download
	DownloadMinSplitKb    = 5120
	DownloadSplitCount    = 3
	DownloadMaxSplitCount = 15

	// Common
	Retries = 3
)

Variables

View Source
var ExitCodeError = ExitCode{1}
View Source
var ExitCodeFailNoOp = ExitCode{2}
View Source
var ExitCodeNoError = ExitCode{0}

Functions

func CheckErrorWithMessage

func CheckErrorWithMessage(err error, message string) error

func ExitOnErr

func ExitOnErr(err error)

func FailNoOp

func FailNoOp(err error, success, failed int, failNoOp bool)

func GetBoolEnvValue

func GetBoolEnvValue(flagName string, defValue bool) (bool, error)

func GetConfigVersion

func GetConfigVersion() string

func GetDocumentationMessage

func GetDocumentationMessage() string

func GetIntFlagValue

func GetIntFlagValue(c *cli.Context, flagName string, defValue int) (int, error)

func GetStringsArrFlagValue

func GetStringsArrFlagValue(c *cli.Context, flagName string) (resultArray []string)

func GetVersion

func GetVersion() string

func InteractiveConfirm

func InteractiveConfirm(message string) bool

func IsWindows

func IsWindows() bool

func PanicOnError

func PanicOnError(err error) error

func PrintHelpAndExitWithError

func PrintHelpAndExitWithError(msg string, context *cli.Context)

func PrintSummaryReport

func PrintSummaryReport(success, failed int, err error) error

Print summary report. The given error will pass through and be returned as is if no other errors are raised.

func SpecVarsStringToMap

func SpecVarsStringToMap(rawVars string) map[string]string

func SumTrueValues

func SumTrueValues(boolArr []bool) int

Types

type Credentials

type Credentials interface {
	SetUser(string)
	SetPassword(string)
	GetUser() string
	GetPassword() string
}

type ExitCode

type ExitCode struct {
	Code int
}

Exit codes:

func GetExitCode

func GetExitCode(err error, success, failed int, failNoOp bool) ExitCode

type OnError

type OnError string

Error modes (how should the application behave when the CheckError function is invoked):

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL