plugin

package
v6.11.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2015 License: Apache-2.0 Imports: 7 Imported by: 469

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)
	GetCurrentOrg() (plugin_models.Organization, error)
	GetCurrentSpace() (plugin_models.Space, error)
	Username() (string, error)
	UserGuid() (string, error)
	UserEmail() (string, error)
	IsLoggedIn() (bool, error)
	IsSSLDisabled() (bool, error)
	HasOrganization() (bool, error)
	HasSpace() (bool, error)
	ApiEndpoint() (string, error)
	ApiVersion() (string, error)
	HasAPIEndpoint() (bool, error)
	LoggregatorEndpoint() (string, error)
	DopplerEndpoint() (string, error)
	AccessToken() (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