coreutils

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// General core constants
	OnErrorPanic OnError = "panic"

	// Common
	TokenRefreshDisabled        = 0
	TokenRefreshDefaultInterval = 60

	// Home Dir
	JfrogCertsDirName        = "certs"
	JfrogConfigFile          = "jfrog-cli.conf"
	JfrogDependenciesDirName = "dependencies"
	JfrogSecurityDirName     = "security"
	JfrogSecurityConfFile    = "security.yaml"
	JfrogBackupDirName       = "backup"
	JfrogLogsDirName         = "logs"
	JfrogLockDirName         = "lock"
	JfrogPluginsDirName      = "plugins"

	// Env
	ErrorHandling   = "JFROG_CLI_ERROR_HANDLING"
	TempDir         = "JFROG_CLI_TEMP_DIR"
	LogLevel        = "JFROG_CLI_LOG_LEVEL"
	ReportUsage     = "JFROG_CLI_REPORT_USAGE"
	HomeDir         = "JFROG_CLI_HOME_DIR"
	DependenciesDir = "JFROG_CLI_DEPENDENCIES_DIR"
	BuildName       = "JFROG_CLI_BUILD_NAME"
	BuildNumber     = "JFROG_CLI_BUILD_NUMBER"
	Project         = "JFROG_CLI_BUILD_PROJECT"
	CI              = "CI"
	// Deprecated:
	JfrogHomeEnv = "JFROG_CLI_HOME"
)

Variables

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

Functions

func AskYesNo

func AskYesNo(promptPrefix string, defaultValue bool) bool

Ask a yes or no question, with a default answer.

func CreateDirInJfrogHome

func CreateDirInJfrogHome(dirName string) (string, error)

func ExitOnErr

func ExitOnErr(err error)

func GetCliPersistentTempDirPath

func GetCliPersistentTempDirPath() string

Return the path of CLI temp dir. This path should be persistent, meaning - should not be cleared at the end of a CLI run.

func GetCliUserAgent

func GetCliUserAgent() string

func GetClientAgent

func GetClientAgent() string

func GetConfigVersion

func GetConfigVersion() int

func GetJfrogBackupDir

func GetJfrogBackupDir() (string, error)

func GetJfrogCertsDir

func GetJfrogCertsDir() (string, error)

func GetJfrogHomeDir

func GetJfrogHomeDir() (string, error)

func GetJfrogPluginsDir

func GetJfrogPluginsDir() (string, error)

func GetJfrogSecurityConfFilePath

func GetJfrogSecurityConfFilePath() (string, error)

func GetJfrogSecurityDir

func GetJfrogSecurityDir() (string, error)

func GetUserAgent

func GetUserAgent() string

func GetVersion

func GetVersion() string

func IsLinux

func IsLinux() bool

func IsWindows

func IsWindows() bool

func PanicOnError

func PanicOnError(err error) error

func ReplaceVars

func ReplaceVars(content []byte, specVars map[string]string) []byte

func SetCliUserAgent

func SetCliUserAgent(cliUserAgentToSet string)

func SetClientAgent

func SetClientAgent(clientAgentToSet string)

func SetVersion

func SetVersion(versionToSet string)

func SpecVarsStringToMap

func SpecVarsStringToMap(rawVars string) map[string]string

func SumTrueValues

func SumTrueValues(boolArr []bool) int

Types

type CliError

type CliError struct {
	ExitCode
	ErrorMsg string
}

func (CliError) Error

func (err CliError) Error() string

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