step

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const KindChecklist = "Checklist"

KindChecklist defines the name for a checklist step in the config file

View Source
const KindCommand = "Command"

KindCommand defines the name for a command step in the config file

View Source
const KindCopy = "Copy"

KindCopy is the name used to define this kind of step in the config file

View Source
const KindCreateFolder = "CreateFolder"

KindCreateFolder defines the name for a create folder step in the config file

View Source
const KindDelete = "Delete"

KindDelete defines the name for a delete step in the config file

View Source
const KindDownload = "Download"

KindDownload defines the name for a download step in the config file

View Source
const KindService = "Service"

KindService defines the name for a step that can start/stop a service

View Source
const KindUnzip = "Unzip"

KindUnzip defines the name for a unzip step in the config file

View Source
const KindWatch = "Watch"

KindWatch defines the name for a log step in the config file

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.

Types

type Checklist

type Checklist struct {
	model.RunnableStep
	// Items represents the individual checks the user has to tick
	Items []string
	// Message can be used to give the user and indication of what the checklist is used for
	Message string
}

Checklist is a step used to show the user a list of items to tick

func (Checklist) Execute

func (checklist Checklist) Execute() (result model.Result)

Execute shows the checklist to the user

func (*Checklist) FromConfig

func (checklist *Checklist) FromConfig(configYaml map[string]interface{}) error

FromConfig creates the struct representation of a step showing a checklist

func (Checklist) GetDescription

func (checklist Checklist) GetDescription() string

GetDescription returns a summary of what this steps does

func (Checklist) GetKind

func (checklist Checklist) GetKind() string

GetKind returns the type this step is of

type Command

type Command struct {
	model.RunnableStep
	Command string
	Args    []string
	Path    string
	// Whether or not the output of the command is printed to the console
	Silent bool
}

Command executes the defined command

func (Command) Execute

func (command Command) Execute() (result model.Result)

Execute runs the defined command

func (*Command) FromConfig

func (command *Command) FromConfig(stepConfig map[string]interface{}) error

FromConfig creates a command struct from the given config

func (Command) GetDescription

func (command Command) GetDescription() string

GetDescription gives a description of what this step does

func (Command) GetKind

func (command Command) GetKind() string

GetKind returns the kind this step represents

type Copy

type Copy struct {
	model.RunnableStep
	Source      string
	Destination string
}

Copy represents the struct of a step type that can be used to copy a file or folder

func (Copy) Execute

func (copy Copy) Execute() (result model.Result)

Execute determins if a file or folder has to be copied an triggers the apropiate copy operation

func (*Copy) FromConfig

func (copy *Copy) FromConfig(stepConfig map[string]interface{}) error

FromConfig creates the copy struct based on the provided config data

func (Copy) GetDescription

func (copy Copy) GetDescription() string

GetDescription gives a short summary of what this step does

func (Copy) GetKind

func (copy Copy) GetKind() string

GetKind returns the type of this step

type CreateFolder

type CreateFolder struct {
	model.RunnableStep
	Path string
}

CreateFolder is a step that is used to create a folder

func (CreateFolder) Execute

func (createFolder CreateFolder) Execute() model.Result

Execute create a folder at a defined path

func (*CreateFolder) FromConfig

func (createFolder *CreateFolder) FromConfig(configYaml map[string]interface{}) error

FromConfig create the struct representation of a step creating a folder

func (CreateFolder) GetDescription

func (createFolder CreateFolder) GetDescription() string

GetDescription returns a summary of what this step does

func (CreateFolder) GetKind

func (createFolder CreateFolder) GetKind() string

GetKind returns the type this step is of

type Delete

type Delete struct {
	model.RunnableStep
	Path string
}

Delete is a step used to delete a file/folder

func (Delete) Execute

func (delete Delete) Execute() model.Result

Execute trigger the deletion of a file/folder

func (*Delete) FromConfig

func (delete *Delete) FromConfig(configYaml map[string]interface{}) error

FromConfig creates the struct representation of a step deleting a file/folder

func (Delete) GetDescription

func (delete Delete) GetDescription() string

GetDescription returns a summary of what this step does

func (Delete) GetKind

func (delete Delete) GetKind() string

GetKind returns the type this step is of

type Download

type Download struct {
	model.RunnableStep
	URL  string
	Path string
}

Download represents a step used to download a file from aj url

func (Download) Execute

func (download Download) Execute() (result model.Result)

Execute downloads the file found at a given url

func (*Download) FromConfig

func (download *Download) FromConfig(configYaml map[string]interface{}) error

FromConfig creates the struct representation of a download step

func (Download) GetDescription

func (download Download) GetDescription() string

GetDescription returns a text summarizing what this step does

func (Download) GetKind

func (download Download) GetKind() string

GetKind returns the type this step is of

type Service

type Service struct {
	model.RunnableStep
	// Name of the Servie according to it's preferences. (Attention: In Windows there is a "service name" and a "display name". Here the "service name" has to be used.)
	Name string
	// Action whether to "start/stop" the service
	Action string
}

Service represents a step used to start/stop a service

func (*Service) Execute

func (service *Service) Execute() model.Result

Execute starts/stops a service

func (*Service) FromConfig

func (service *Service) FromConfig(configYaml map[string]interface{}) error

FromConfig creates the struct representation of a service step

func (Service) GetDescription

func (service Service) GetDescription() string

GetDescription returns a text summarizing what this step does

func (Service) GetKind

func (service Service) GetKind() string

GetKind returns the type this step is of

type Unzip

type Unzip struct {
	model.RunnableStep
	Source      string
	Destination string
}

Unzip represents a task used to unzip a zip archive file

func (Unzip) Execute

func (unzip Unzip) Execute() model.Result

Execute unzips a file to a defined location

func (*Unzip) FromConfig

func (unzip *Unzip) FromConfig(configYaml map[string]interface{}) error

FromConfig creates the struct representation of a unzip step

func (Unzip) GetDescription

func (unzip Unzip) GetDescription() string

GetDescription returns a text summarizing what this step does

func (Unzip) GetKind

func (unzip Unzip) GetKind() string

GetKind returns the type this step is of

type Watch

type Watch struct {
	model.RunnableStep
	// Path is the location the file to be watched can be found
	Path string
	// Message is the string which the file is watched for
	Message string
	// Timeout in seconds after which watching the file will be interrupted (default time out is )
	Timeout int
}

Watch is a step used to watch a file

func (Watch) Execute

func (watch Watch) Execute() (result model.Result)

Execute starts the file watcher and terminates it if the defined string appeared or a timeout is reached.

func (*Watch) FromConfig

func (watch *Watch) FromConfig(configYaml map[string]interface{}) error

FromConfig creates the struct representation of a step watching a file for a certain string

func (Watch) GetDescription

func (watch Watch) GetDescription() string

GetDescription returns a summary of what this step does

func (Watch) GetKind

func (watch Watch) GetKind() string

GetKind returns the type this step is of

Jump to

Keyboard shortcuts

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