plugin

package
v6.6.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2014 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdExists

func CmdExists(cmd string, availableCmds []Command) bool

func ServeCommand

func ServeCommand(cmd RpcPlugin)

*

  • This function is called by the plugin to setup their server. This allows us to call Run on the plugin
  • os.Args[1] port plugin rpc will be listening on
  • os.Args[2] port CF_CLI rpc server is running on
  • os.Args[3] **OPTIONAL**
  • install-plugin - used to fetch the command name

*

Types

type Command

type Command struct {
	Name     string
	HelpText string
}

type RpcPlugin

type RpcPlugin interface {
	//run is passed in all the command line parameter arguments and
	//an object containing all of the cli commands available to them
	Run(args string, reply *bool) error
	CmdExists(args string, exists *bool) error

	//We only care about the return value.
	//TODO: the first param could be used for obtaining help of a specific command.
	ListCmds(empty string, cmdList *[]Command) error
}

*

Command interface needs to be implementd for a runnable sub-command of `cf`

*

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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