plugin

package
v6.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCliConnection

func NewCliConnection(cliServerPort string) *cliConnection

func Start

func Start(cmd Plugin)

*

  • This function is called by the plugin to setup their server. This allows us to call Run on the plugin
  • os.Args[1] port CF_CLI rpc server is running on
  • os.Args[2] **OPTIONAL**
  • SendMetadata - used to fetch the plugin metadata

*

Types

type CliConnection

type CliConnection interface {
	CliCommandWithoutTerminalOutput(args ...string) ([]string, error)
	CliCommand(args ...string) ([]string, error)
}

*

List of commands avaiable to CliConnection variable passed into run

*

type Command

type Command struct {
	Name         string
	Alias        string
	HelpText     string
	UsageDetails Usage //Detail usage to be displayed in `cf help <cmd>`
}

type Plugin

type Plugin interface {
	Run(cliConnection CliConnection, args []string)
	GetMetadata() PluginMetadata
}

*

Command interface needs to be implemented for a runnable plugin of `cf`

*

type PluginMetadata

type PluginMetadata struct {
	Name     string
	Version  VersionType
	Commands []Command
}

type Usage

type Usage struct {
	Usage   string
	Options map[string]string
}

type VersionType

type VersionType struct {
	Major int
	Minor int
	Build int
}

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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