plugin

package
Version: v6.16.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2016 License: Apache-2.0 Imports: 8 Imported by: 313

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MinCliVersionStr

func MinCliVersionStr(version VersionType) string

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)
	GetApp(string) (plugin_models.GetAppModel, error)
	GetApps() ([]plugin_models.GetAppsModel, error)
	GetOrgs() ([]plugin_models.GetOrgs_Model, error)
	GetSpaces() ([]plugin_models.GetSpaces_Model, error)
	GetOrgUsers(string, ...string) ([]plugin_models.GetOrgUsers_Model, error)
	GetSpaceUsers(string, string) ([]plugin_models.GetSpaceUsers_Model, error)
	GetServices() ([]plugin_models.GetServices_Model, error)
	GetService(string) (plugin_models.GetService_Model, error)
	GetOrg(string) (plugin_models.GetOrg_Model, error)
	GetSpace(string) (plugin_models.GetSpace_Model, 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
	MinCliVersion 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
rpc
fakes
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