plugin

package
v0.0.0-...-4f682fb Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

Command is a plugin for runinng commands in the shell.

func NewCommand

func NewCommand() *Command

NewCommand initializes an instance of the plugin.

func (Command) Run

func (Command) Run(ctx context.Context, opts *RunOpts)

Run executes a command instructions for a given step.

type Manager

type Manager struct {
	DockerClient docker.Docker
	Plugins      map[string]Plugin
}

Manager contains information about plugins.

func NewManager

func NewManager(docker docker.Docker) *Manager

NewManager initializes a new Plugin Manager

func (*Manager) Add

func (manager *Manager) Add(key string, plugin Plugin)

Add adds a new plugin to the list.

func (*Manager) Get

func (manager *Manager) Get(key string) Plugin

Get returns a plugin based on the key.

func (*Manager) Run

func (manager *Manager) Run(ctx context.Context, buildID string, serviceName string,
	containerID string, stepNumber int, step *types.Step) error

Run runs a step using the correct plugin.

type Plugin

type Plugin interface {
	Run(ctx context.Context, opts *RunOpts)
}

Plugin is the interface all plugins must implement.

type RunOpts

type RunOpts struct {
	BuildID      string
	ServiceName  string
	ContainerID  string
	StepNumber   int32
	Step         *types.Step
	DockerClient docker.Docker
}

RunOpts are the options for running a step.

Jump to

Keyboard shortcuts

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