launch

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

type Exec interface {

	// Name returns the name of the launcher.  This is used to identify
	// which launcher to use in configurations or command line flags
	Name() string

	// Exec starts the plugin given the name of the plugin and
	// the command and args to start it.
	// This can be an async process but the launcher will poll for the running
	// status of the plugin.
	// The client can receive and block on the returned channel
	// and add optional timeout in its own select statement.
	Exec(name string, config *types.Any) (<-chan error, error)
}

Exec is a service that is able to start plugins based on different mechanisms from running local binary to pulling and running docker containers or engine plugins

func NewNoOpExec

func NewNoOpExec() Exec

NewNoOpExec doesn't actually launch the plugins. It's a stub with no op and relies on manual plugin starts.

type ExecName added in v0.3.0

type ExecName string

ExecName is the name of the executor to use (e.g. 'os', 'docker-run', etc.). It's found in the config.

type Monitor

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

Monitor runs continuously receiving requests to start a plugin. Monitor uses a launcher to actually start the process of the plugin.

func NewMonitor

func NewMonitor(l Exec, rules []Rule) *Monitor

NewMonitor returns a monitor that continuously watches for input requests and launches the process for the plugin, if not already running. The configuration to use in the config is matched to the Name() of the executor (the field Exec).

func (*Monitor) Start

func (m *Monitor) Start() (chan<- StartPlugin, error)

Start starts the monitor and returns a channel for sending requests to launch plugins. Closing the channel effectively stops the monitor loop.

func (*Monitor) Stop

func (m *Monitor) Stop()

Stop stops the monitor

type Rule

type Rule struct {

	// Plugin is the name of the plugin
	Plugin plugin.Name

	// Launch is the rule for starting / launching the plugin. It's a dictionary with the key being
	// the name of the executor and the value being the properties used by that executor.
	Launch map[ExecName]*types.Any
}

Rule provides the instructions on starting the plugin

type StartPlugin

type StartPlugin struct {
	Plugin  plugin.Name
	Started func(*types.Any)
	Error   func(*types.Any, error)
}

StartPlugin is the command to start a plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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