Documentation
¶
Index ¶
- Constants
- Variables
- func CheckError(err error)
- func CheckFatal(err error)
- func CreateMissingDevboxFiles(name string)
- func FileExists(path string) bool
- func FindCommand(op string) *command
- func ForceExit(msg string, exitCode int)
- func ForceFatal(msg string)
- func GetCommandData() map[string][]bashcompletion.Completion
- func GetCommandNames() []string
- func GetDevboxConfigPath(name string) string
- func GetDevboxDir() string
- func GetDevboxPath(name string) string
- func GetMaxCommandNameLength() int
- func GetMaxCommandUsageLength() int
- func GetRepoDir() string
- func GetStorageDir() string
- func GetWorkspaceConfigPath(name string) string
- func GetWorkspaceDir() string
- func GetWorkspacePath(name string) string
- func InitErrorRegistry()
- func ListCommands()
- func Must(err error, exclude ...string)
- func RegisterCommand(op string, help string, args ArgInfoList, run func(arg ...string) error)
- func RegisterHiddenCommand(op string, args ArgInfoList, run func(arg ...string) error)
- type ArgInfo
- type ArgInfoList
Constants ¶
View Source
const ( EXIT_OK = iota EXIT_NEED_SUDO EXIT_INVALID_ARGS EXIT_MISSING_ARGS EXIT_TOO_MANY_ARGS EXIT_FILE_NOT_FOUND EXIT_DEVBOX_NOT_FOUND EXIT_REPO_CONNECTION_FAILED EXIT_REPO_DOWNLOAD_FAILED EXIT_REPO_UPLOAD_FAILED EXIT_REPO_CHECK_FAILED EXIT_WORKSPACE_PUSH_FAILED EXIT_WORKSPACE_PULL_FAILED EXIT_WORKSPACE_STORE_FAILED EXIT_WORKSPACE_RESTORE_FAILED EXIT_UNKNOWN_ERROR EXIT_UNKNOWN_FATAL )
View Source
const ( ERR_INVALID_ARGS = "invalid args" ERR_MISSING_ARGS = "missing required argument" ERR_TOO_MANY_ARGS = "too many arguments" ERR_FILE_NOT_FOUND = "no such file or directory" ERR_DEVBOX_NOT_FOUND = "devbox not found" ERR_FATAL = "fatal error" CONFIG_FILE = "config.yaml" START_SCRIPT_FILE = "usr/local/bin/start" STOP_SCRIPT_FILE = "usr/local/bin/stop" APP_NAME = "devbox" )
View Source
const ( ARG_TYPE_DIR = iota ARG_TYPE_BOOL ARG_TYPE_FILE ARG_TYPE_TARBALL ARG_TYPE_IP ARG_TYPE_COMMAND ARG_TYPE_DEVBOX_LIST ARG_TYPE_WORKSPACE_LIST ARG_TYPE_SESSION_LIST )
Variables ¶
Functions ¶
func CheckError ¶
func CheckError(err error)
CheckError will try to register the given error as a non-fatal error and then check if the given error matches a known one (which should always be the case). If err == nil the function will exit immediately.
func CheckFatal ¶
func CheckFatal(err error)
CheckFatal will check if the given error is a fatal error and if so, it will exit with the registered exit code. If err == nil the function will exit immediately.
func CreateMissingDevboxFiles ¶
func CreateMissingDevboxFiles(name string)
func FileExists ¶
func FindCommand ¶
func FindCommand(op string) *command
func ForceFatal ¶
func ForceFatal(msg string)
func GetCommandData ¶
func GetCommandData() map[string][]bashcompletion.Completion
func GetCommandNames ¶
func GetCommandNames() []string
func GetDevboxConfigPath ¶
func GetDevboxDir ¶
func GetDevboxDir() string
func GetDevboxPath ¶
func GetMaxCommandNameLength ¶
func GetMaxCommandNameLength() int
func GetMaxCommandUsageLength ¶
func GetMaxCommandUsageLength() int
func GetRepoDir ¶
func GetRepoDir() string
func GetStorageDir ¶
func GetStorageDir() string
func GetWorkspaceConfigPath ¶
func GetWorkspaceDir ¶
func GetWorkspaceDir() string
func GetWorkspacePath ¶
func InitErrorRegistry ¶
func InitErrorRegistry()
func ListCommands ¶
func ListCommands()
func RegisterCommand ¶
func RegisterCommand( op string, help string, args ArgInfoList, run func(arg ...string) error, )
func RegisterHiddenCommand ¶
func RegisterHiddenCommand( op string, args ArgInfoList, run func(arg ...string) error, )
Types ¶
type ArgInfo ¶
type ArgInfo struct { Optional bool Variadic bool Type int Name string Example string OptionalSuffix string }
func (*ArgInfo) Completion ¶
func (ai *ArgInfo) Completion() bashcompletion.Completion
func (*ArgInfo) StringANSI ¶
type ArgInfoList ¶
type ArgInfoList []ArgInfo
func (*ArgInfoList) Example ¶
func (ail *ArgInfoList) Example() string
func (*ArgInfoList) NumArgs ¶
func (ail *ArgInfoList) NumArgs() (min, max int)
func (*ArgInfoList) String ¶
func (ail *ArgInfoList) String() string
func (*ArgInfoList) StringANSI ¶
func (ail *ArgInfoList) StringANSI() string
Click to show internal directories.
Click to hide internal directories.