runcommands

package
v0.0.0-...-6cf1bc9 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2016 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommandsResolver

func NewCommandsResolver(commands Commands, commandCompleted func(string)) resolver.Resolver

NewCommandsResolver returns a new Resolver that returns operations to execute "juju run" commands.

The returned resolver's NextOp method will return operations to execute run commands whenever the remote state's "Commands" is non-empty, by taking the first ID in the sequence and fetching the command arguments from the Commands interface passed into this function. When the command execution operation is committed, the ID of the command is passed to the "commandCompleted" callback.

Types

type Commands

type Commands interface {
	// AddCommand adds the given command arguments and response function
	// and returns a unique identifier.
	AddCommand(operation.CommandArgs, operation.CommandResponseFunc) string

	// GetCommand returns the command arguments and response function
	// with the specified ID, as registered in AddCommand.
	GetCommand(id string) (operation.CommandArgs, operation.CommandResponseFunc)

	// RemoveCommand removes the command arguments and response function
	// associated with the specified ID.
	RemoveCommand(id string)
}

Commands is an interface providing a means of storing and retrieving arguments for running commands.

func NewCommands

func NewCommands() Commands

Jump to

Keyboard shortcuts

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