plugins

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2018 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckFailedAfterTaskErr = errors.New("Check failed after tasks was executed")

CheckFailedAfterTaskErr is the error that is returned if task is run but check doesnt pass afterwards

View Source
var List = []Plugin{
	&Docker{},
	&Node{},
}

List is a list of all available plugins

Functions

func RunChecks

func RunChecks(tasks []Task) (pass bool, err error)

RunChecks returns the result of calling the check function of all the tasks passed in. Returns as soon as one returns false or an error. If an error occurs, false, error witll be returned

func RunTask

func RunTask(task Task) (err error)

func RunTasks

func RunTasks(tasks []Task) (err error)

RunTasks runs all tasks. First checks the check. If check returns false the task is executed. The check is checked again after the task is executed.

Types

type Brew

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

Brew plugin struct

func (Brew) Down

func (b Brew) Down(c *parser.ProjectConfigStruct)

func (*Brew) Install

func (b *Brew) Install(c *parser.ProjectConfigStruct)

func (Brew) IsProjectType

func (n Brew) IsProjectType(c *parser.ProjectConfigStruct) bool

func (Brew) PostInstall

func (b Brew) PostInstall(c *parser.ProjectConfigStruct)

func (Brew) PostScript

func (b Brew) PostScript(c *parser.ProjectConfigStruct)

func (*Brew) PreInstall

func (b *Brew) PreInstall(c *parser.ProjectConfigStruct)

func (Brew) PreScript

func (b Brew) PreScript(c *parser.ProjectConfigStruct)

func (Brew) Scripts

func (*Brew) Setup

func (b *Brew) Setup()

Setup for brew installs brew if it is not installed

type Docker

type Docker struct{}

Docker plugin struct

func (Docker) Down

func (d Docker) Down(c *parser.ProjectConfigStruct)

func (Docker) Install

func (n Docker) Install(c *parser.ProjectConfigStruct)

func (Docker) IsProjectType

func (n Docker) IsProjectType(c *parser.ProjectConfigStruct) bool

func (Docker) PostInstall

func (n Docker) PostInstall(c *parser.ProjectConfigStruct)

func (Docker) PostScript

func (d Docker) PostScript(c *parser.ProjectConfigStruct)

func (Docker) PreInstall

func (d Docker) PreInstall(c *parser.ProjectConfigStruct)

func (Docker) PreScript

func (d Docker) PreScript(c *parser.ProjectConfigStruct)

func (Docker) Scripts

func (d Docker) Scripts(c *parser.ProjectConfigStruct) (scripts map[string]utilities.RunCommand)

func (Docker) Setup

func (d Docker) Setup()

func (Docker) String

func (d Docker) String() string

func (Docker) UpTasks

func (d Docker) UpTasks(config *parser.ProjectConfigStruct) (tasks [][]Task, err error)

type DockerCompose

type DockerCompose struct {
}

func (*DockerCompose) Down

func (*DockerCompose) Install

func (d *DockerCompose) Install(c *parser.ProjectConfigStruct)

func (*DockerCompose) IsProjectType

func (d *DockerCompose) IsProjectType(c *parser.ProjectConfigStruct) bool

func (*DockerCompose) PostInstall

func (d *DockerCompose) PostInstall(c *parser.ProjectConfigStruct)

func (*DockerCompose) PostScript

func (d *DockerCompose) PostScript(c *parser.ProjectConfigStruct)

func (*DockerCompose) PreInstall

func (d *DockerCompose) PreInstall(c *parser.ProjectConfigStruct)

func (*DockerCompose) PreScript

func (d *DockerCompose) PreScript(c *parser.ProjectConfigStruct)

func (*DockerCompose) Scripts

func (DockerCompose) Setup

func (d DockerCompose) Setup()

type Golang

type Golang struct {
}

func (Golang) Check

func (g Golang) Check(c *parser.ProjectConfigStruct) bool

func (Golang) Down

func (g Golang) Down(c *parser.ProjectConfigStruct)

func (Golang) Install

func (g Golang) Install(c *parser.ProjectConfigStruct)

func (Golang) IsProjectType

func (g Golang) IsProjectType(c *parser.ProjectConfigStruct) bool

func (Golang) PostInstall

func (g Golang) PostInstall(c *parser.ProjectConfigStruct)

func (Golang) PostScript

func (g Golang) PostScript(c *parser.ProjectConfigStruct)

func (Golang) PreInstall

func (g Golang) PreInstall(c *parser.ProjectConfigStruct)

func (Golang) PreScript

func (g Golang) PreScript(c *parser.ProjectConfigStruct)

func (Golang) Scripts

func (Golang) Setup

func (g Golang) Setup()

func (Golang) String

func (g Golang) String() string

func (Golang) Up

type Node

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

func (Node) Down

func (n Node) Down(c *parser.ProjectConfigStruct)

func (*Node) Install

func (n *Node) Install(c *parser.ProjectConfigStruct)

func (Node) IsProjectType

func (n Node) IsProjectType(c *parser.ProjectConfigStruct) bool

func (Node) PostInstall

func (n Node) PostInstall(c *parser.ProjectConfigStruct)

func (Node) PostScript

func (n Node) PostScript(c *parser.ProjectConfigStruct)

func (*Node) PreInstall

func (n *Node) PreInstall(c *parser.ProjectConfigStruct)

func (Node) PreScript

func (n Node) PreScript(c *parser.ProjectConfigStruct)

func (Node) Scripts

func (Node) Setup

func (n Node) Setup()

func (Node) String

func (n Node) String() string

func (Node) UpTasks

func (n Node) UpTasks(*parser.ProjectConfigStruct) (tasks [][]Task, err error)

type Plugin

type Plugin interface {
	// implement stringer interface
	String() string

	// Runs on devctl install or upgrade
	Setup()

	// Tasks initializes tasks required during the up stage.
	// The tasks returned by Tasks will be run in order
	// Note: tasks are not passed ProjectConfig as such need to be initialized with required values
	UpTasks(*parser.ProjectConfigStruct) (tasks [][]Task, err error)

	PreInstall(*parser.ProjectConfigStruct)
	Install(*parser.ProjectConfigStruct)
	PostInstall(*parser.ProjectConfigStruct)
	PreScript(*parser.ProjectConfigStruct)
	Scripts(c *parser.ProjectConfigStruct) map[string]utilities.RunCommand
	PostScript(*parser.ProjectConfigStruct)
	Down(*parser.ProjectConfigStruct)

	// Returns true if plugin applies to the current plugin
	IsProjectType(*parser.ProjectConfigStruct) bool
}

Plugin interfaceUse

func Used

Used calls IsProjectType on each element on the PluginList array and returns a filtered version

type Python

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

func (Python) Down

func (n Python) Down(c *parser.ProjectConfigStruct)

func (*Python) Install

func (n *Python) Install(c *parser.ProjectConfigStruct)

func (Python) IsProjectType

func (n Python) IsProjectType(c *parser.ProjectConfigStruct) bool

func (Python) PostInstall

func (n Python) PostInstall(c *parser.ProjectConfigStruct)

func (Python) PostScript

func (n Python) PostScript(c *parser.ProjectConfigStruct)

func (*Python) PreInstall

func (p *Python) PreInstall(c *parser.ProjectConfigStruct)

func (Python) PreScript

func (n Python) PreScript(c *parser.ProjectConfigStruct)

func (Python) Scripts

func (*Python) Setup

func (p *Python) Setup()

type Service

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

type Task

type Task interface {
	String() string
	Check() (bool, error)
	Execute() error
}

Task is the interface used by task runner

Jump to

Keyboard shortcuts

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