pkg

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScrambledFileName = ".scrambled.yml"
)

Variables

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 PrintError

func PrintError(m modules.IModule, eggl *models.EggLog) bool

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

func RecoverFromScrambled(eggl *models.EggLog, templatesFS embed.FS, mappingYaml string) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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