task

package
v0.0.0-...-d99f4a2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task is used for performing tasks/actions

func New

func New(config []byte, packageFiles embed.FS, tmplOptions TemplateOptions) (*Task, error)

New parses the input config and returns a Task, log chan, error if any function parameters: config -> is the user defined task list JSON packageFiles -> embedded file system that the wizard will use to perform actions on tmplOptions -> for template action

func NewWithLog

func NewWithLog(config []byte, packageFiles embed.FS, tmplOptions TemplateOptions) (*Task, chan interface{}, error)

NewWithLog parses the config and returns task struct

func (*Task) Execute

func (t *Task) Execute() ([]interface{}, error)

Execute iterates through each task and performs actions based on the priority list Returns an []interface, error []interface are logs of wlog pkg types

func (*Task) Perform

func (t *Task) Perform(logCh chan interface{}) error

Perform iterates through each task and performs actions based on the priority list Takes the log chan as input parameter to input logs

type TemplateOptions

type TemplateOptions struct {
	EnableWizardFacts bool
	TemplateConfig    interface{}
}

TemplateOptions are used for the template action If EnableWizardFacts is set to 'true' then the wizard can use all the ENV variables and some predefined facts in the template TemplateConfig is the user defined structure to use in the template

Jump to

Keyboard shortcuts

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