Documentation ¶
Overview ¶
Package recipe provides two objects and manage their workflow:
- Recipe : set of steps selected by the user (by tags/step type or step name on CLI)
- Cookbook: set of recipes selected by the user (by name of recipe on the CLI)
The folder of a recipe must contains at least two folders:
- steps containing the step files of the recipe
- datasources containing the datasource files to be used by the recipe
but it can also contain whatever files/folders needed for the steps (initial dataset, templates, script, etc...). All the relative path defined in a step will be relative to the recipe folder.
Index ¶
- type Cookbook
- func (ck *Cookbook) Do(ctx context.Context, log *logrus.Entry) bool
- func (ck *Cookbook) Load(ctx context.Context, log *logrus.Entry, configPath string, recipes []string, ...) error
- func (ck *Cookbook) PostLoad(log *logrus.Entry, superseed map[string]string) error
- func (ck *Cookbook) Statistics() (map[string][]int, int)
- type Cooker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cookbook ¶
type Cookbook struct { Recipes map[string]recipe // contains filtered or unexported fields }
Cookbook is a map of recipe indexed by recipe's name.
func New ¶
func New(sf step.Creater, connectionTimeout time.Duration, connectionRetry int, force bool, sequential bool, validate bool, dryRun bool) *Cookbook
New returns a new.
func (*Cookbook) Do ¶
Do will start one parallel recipe executor by recipe Each recipe executor will run all the steps of the recipes by priorities. All the step of same priority level will be parellelized or sequentialized (defined by the Cookbook.sequential flags), and the executor will wait for all them before starting the next batch of step. If an error occurs in one of the steps or user CTRL+C , all the same priority level steps will receive an cancelation that they could use to rollback by example and all the step with a priority level not already launched will not be runned.
func (*Cookbook) Load ¶
func (ck *Cookbook) Load(ctx context.Context, log *logrus.Entry, configPath string, recipes []string, limitedTags []string, stepNames []string, stepTypes []string) error
Load Lookup the provided folder for recipes folder and will return a Cookbook of the selected recipes/steps. For each recipe, it will load all datasources and the selected steps.