Documentation ¶
Index ¶
- Constants
- func AppendToFile(filePath string, element string) error
- func Contains(elems []string, v string) bool
- func ExistsInFile(filePath string, element string) (bool, error)
- func GetUser() string
- type EncapsulatedError
- func CommitCurrentEnv() *EncapsulatedError
- func Init(configFilePathFlag string) *EncapsulatedError
- func ListEnvironments() *EncapsulatedError
- func NewEncapsulatedError(err error, message string, solution string) *EncapsulatedError
- func RemoveEnv(envName string) *EncapsulatedError
- func RestoreEnv() *EncapsulatedError
- func SelectEnvironment(envName string) *EncapsulatedError
- func StoreConfigFile(path string, envName string) (int64, *EncapsulatedError)
- func UseConfigFile(envName string, createEnv bool) (int64, *EncapsulatedError)
- type ErrorCode
- type JorgeConfig
- type SolutionMessage
Constants ¶
const ( // E000 System level errors E000 ErrorCode = "The active directory does not exist" E001 ErrorCode = "Directory already exist" // Already exists E002 ErrorCode = "Path is not a directory" E003 ErrorCode = "Could not create directory" E004 ErrorCode = "Target file is not a regular file" E005 ErrorCode = "Unknown error" E006 ErrorCode = "Could not open target file" E007 ErrorCode = "Could not write to file" E008 ErrorCode = "Error constructing path" E009 ErrorCode = "Could not delete the target directory" // E100 Application level errors. >= 100 E100 = "Active directory does not belong in a jorge project" E101 = "Path to .jorge is not a directory" E102 = "Envs directory already exist" E103 = "Corrupted internal jorge directory (.jorge)" E104 = "Could not open the jorge configuration" E105 = "Could not read jorge config yaml file" E106 = "Could not write jorge config yaml file" E107 = "Could not read configuration file" E108 = "Could not Create internal directory for the configuration environment" E109 = "Environment already exist" E110 = "Could not store configuration file" E111 = "Environment does not exist" E112 = "Can not delete the active environment" )
const ( // S000 system level messages S000 SolutionMessage = "Please make sure the active directory is a valid path" S001 SolutionMessage = "Make sure %s is a directory" S002 SolutionMessage = "Make sure user %s has write access to the active directory" S003 SolutionMessage = "Make sure %s file exist and is readable by the user" // S100 application level messages S100 = "Please run `jorge init` to initialize a jorge project" S101 = "Do not try to initialize a directory which is already a jorge project" S102 = "" /* 130-byte string literal not displayed */ S103 = "Make sure user %s has write privileges to .jorge directory" S104 = "Please use an environment name that is not already in use. You can use `jorge ls` to see the list of current environments" S105 = "You can create environment by running `jorge use -n %s`" S106 = "Please select another environment or create a new one" )
Variables ¶
This section is empty.
Functions ¶
func AppendToFile ¶
Types ¶
type EncapsulatedError ¶
func CommitCurrentEnv ¶
func CommitCurrentEnv() *EncapsulatedError
CommitCurrentEnv It stores the current active user configuration file under the current selected jorge environment (found at the ./jorge/config.yml file)
func Init ¶
func Init(configFilePathFlag string) *EncapsulatedError
Init Initializes a jorge project by creating the .jorge directory, setting the first environment and requesting the config file path for the user
func ListEnvironments ¶
func ListEnvironments() *EncapsulatedError
ListEnvironments Shows a list with all the available environment for the user
func NewEncapsulatedError ¶
func NewEncapsulatedError(err error, message string, solution string) *EncapsulatedError
func RemoveEnv ¶
func RemoveEnv(envName string) *EncapsulatedError
func RestoreEnv ¶
func RestoreEnv() *EncapsulatedError
RestoreEnv It replaces the current active configuration file, with the one that is stored under the current environment (found under the ./.jorge/config.yml)
func SelectEnvironment ¶
func SelectEnvironment(envName string) *EncapsulatedError
func StoreConfigFile ¶
func StoreConfigFile(path string, envName string) (int64, *EncapsulatedError)
StoreConfigFile It stores the current active user config file under an jorge environment name
func UseConfigFile ¶
func UseConfigFile(envName string, createEnv bool) (int64, *EncapsulatedError)
UseConfigFile It replaces the current active user configuration file with the one that is stored under the jorge environment
type JorgeConfig ¶
type SolutionMessage ¶
type SolutionMessage string
func (SolutionMessage) Str ¶
func (s SolutionMessage) Str(args ...interface{}) string