model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Plans map[string]Plan
}

Config is the complete result of reading the yaml file and creating the possible commands available from it

type Plan

type Plan struct {
	Name        string
	Description string
	Tasks       []Task
}

Plan defines the structure of the equally named node in the config yaml

type Result

type Result struct {
	Message       string
	WasSuccessful bool
}

Result is the outcome of executing a task.

type RunnableStep

type RunnableStep struct {
	Kind        string
	Description string
}

RunnableStep defines the base struct

type Step

type Step interface {
	// GetKind returns the type this step is (i.e. Download,Unzip etc)
	GetKind() string
	// GetDescription return description of what the step does
	GetDescription() string
	// Execute performs the actual work the step is responsible for
	Execute() Result
	// FromConfig read the given map (representing the yaml definition) and creates a step instance of it
	FromConfig(configYaml map[string]interface{}) error
}

Step is the interface defining the methods each step has to implement to be generically executable

type Task

type Task struct {
	Name  string
	Steps []Step
}

Task defines the structure of the equally named node in the config yaml

Jump to

Keyboard shortcuts

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