Documentation
¶
Index ¶
- Constants
- Variables
- func CheckScrambled() bool
- func LoadScrambled() (*configuration.Configuration, []modules.IModule, []modules.IModule, error)
- func PrintError(m modules.IModule, eggl *models.EggLog) bool
- func ProjectFactory(configuration *configuration.Configuration, eggl *models.EggLog, ...) error
- func RecoverFromScrambled(eggl *models.EggLog, templatesFS embed.FS, mappingYaml string) error
- func WriteScrambled(configuration *configuration.Configuration, succeeded []modules.IModule, ...) error
Constants ¶
View Source
const (
ScrambledFileName = ".scrambled.yml"
)
Variables ¶
View Source
var ( Modules = []modules.IModule{ &modules.InitializeModule{}, &modules.InstallToolsModule{}, &modules.InstallLibrariesModule{}, &modules.GenerateConfigurationModule{}, &modules.BootstrapFrameworkFilesFromTemplatesModule{}, &modules.PostInstallSqlcModule{}, &modules.PostInstallPushMigrationsToServer{}, &modules.PostInstallSwagModule{}, &modules.CompleteModule{}, } )
Functions ¶
func CheckScrambled ¶
func CheckScrambled() bool
CheckScrambled
params:
returns:
bool:
type: bool
description:
true if the .scrambled file exists, false otherwise
description:
This function is used to check if the .scrambled file exists. It will return true if the .scrambled file exists, false otherwise.
func LoadScrambled ¶
func LoadScrambled() ( *configuration.Configuration, []modules.IModule, []modules.IModule, error, )
LoadScrambled
params:
returns:
configuration:
type: *configuration.Configuration
description:
the configuration of the project to be loaded from the .scrambled file
succeeded:
type: []modules.IModule
description:
the modules that were successfully run and can be written to the
.scrambled file so that we do not need to repeat them
failed:
type: []modules.IModule
description:
the modules that failed and can be written to the .scrambled file
error:
type: error
description:
the error that occurred during the project recovery
description:
This function is used to load the .scrambled file and return the configuration,
func ProjectFactory ¶
func ProjectFactory(configuration *configuration.Configuration, eggl *models.EggLog, templatesFS embed.FS, mappingYaml string) error
ProjectFactory
params:
configuration:
type: *configuration.Configuration
description:
the configuration of the project to be created
eggl:
type: *models.EggLog
description:
the logger of the project to be created
returns:
error:
type: error
description:
the error that occurred during the project creation
description:
This function is used to create a new project. It will run all the modules in the order they are defined in the Modules slice. If any module fails, it will write the .scrambled file and return an error.
func RecoverFromScrambled ¶
RecoverFromScrambled
params:
eggl:
type: *models.EggLog
description:
the logger of the project to be created
returns:
error:
type: error
description:
the error that occurred during the project recovery
description:
This function is used to recover a project from the .scrambled file. It will load the .scrambled file and run the modules that failed.
func WriteScrambled ¶
func WriteScrambled( configuration *configuration.Configuration, succeeded []modules.IModule, failed modules.IModule, ModuleError error, ) error
WriteScrambled
params:
configuration:
type: *configuration.Configuration
description:
the configuration of the project to be written to the .scrambled file
if so that if there was any errors during the project creation we can
recreate the state of the project from the .scrambled file
succeeded:
type: []modules.IModule
description:
the modules that were successfully run and can be written to the
.scrambled file so that we do not need to repeat them
failed:
type: modules.IModule
description:
the module that failed and can be written to the .scrambled file
err:
type: error
description:
the error that occurred during the project creation
returns:
error: - Any error that occurs while writing the .scrambled file
description:
This function is used to write the .scrambled file to the current directory if there were any errors during the project creation. The .scrambled file contains the modules that were successfully run and the module that failed this allows us to recreate the state of the project from the .scrambled file and re-run the failed module by trusting that the rest of the modules were correct
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.