{"modulePath":"github.com/DaAlbrecht/cf-cli","version":"v0.0.0-20231128151943-1fe19bb400b9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plugin\n\n## Functions\n\n```go\nfunc MinCliVersionStr(version VersionType) string\n```\n\n```go\nfunc NewCliConnection(cliServerPort string) *cliConnection\n```\n\n```go\nfunc Start(cmd Plugin)\n```\n\\*\n\n  - This function is called by the plugin to setup their server. This allows us to call Run on the plugin\n  - os.Args\\[1] port CF\\_CLI rpc server is running on\n  - os.Args\\[2] \\*\\*OPTIONAL\\*\\*\n  - SendMetadata - used to fetch the plugin metadata\n\n\\*\n\n## Types\n\n```go\ntype CliConnection interface {\n\tCliCommandWithoutTerminalOutput(args ...string) ([]string, error)\n\tCliCommand(args ...string) ([]string, error)\n\tGetCurrentOrg() (plugin_models.Organization, error)\n\tGetCurrentSpace() (plugin_models.Space, error)\n\tUsername() (string, error)\n\tUserGuid() (string, error)\n\tUserEmail() (string, error)\n\tIsLoggedIn() (bool, error)\n\t// IsSSLDisabled returns true if and only if the user is connected to the Cloud Controller API with the\n\t// `--skip-ssl-validation` flag set unless the CLI configuration file cannot be read, in which case it\n\t// returns an error.\n\tIsSSLDisabled() (bool, error)\n\tHasOrganization() (bool, error)\n\tHasSpace() (bool, error)\n\tApiEndpoint() (string, error)\n\tApiVersion() (string, error)\n\tHasAPIEndpoint() (bool, error)\n\tLoggregatorEndpoint() (string, error)\n\tDopplerEndpoint() (string, error)\n\tAccessToken() (string, error)\n\tGetApp(string) (plugin_models.GetAppModel, error)\n\tGetApps() ([]plugin_models.GetAppsModel, error)\n\tGetOrgs() ([]plugin_models.GetOrgs_Model, error)\n\tGetSpaces() ([]plugin_models.GetSpaces_Model, error)\n\tGetOrgUsers(string, ...string) ([]plugin_models.GetOrgUsers_Model, error)\n\tGetSpaceUsers(string, string) ([]plugin_models.GetSpaceUsers_Model, error)\n\tGetServices() ([]plugin_models.GetServices_Model, error)\n\tGetService(string) (plugin_models.GetService_Model, error)\n\tGetOrg(string) (plugin_models.GetOrg_Model, error)\n\tGetSpace(string) (plugin_models.GetSpace_Model, error)\n}\n```\n\\*\n\n\tList of commands available to CliConnection variable passed into run\n\n\\*\n\n```go\ntype Command struct {\n\tName         string\n\tAlias        string\n\tHelpText     string\n\tUsageDetails Usage //Detail usage to be displayed in `cf help \u003ccmd\u003e`\n}\n```\n\n```go\ntype Plugin interface {\n\tRun(cliConnection CliConnection, args []string)\n\tGetMetadata() PluginMetadata\n}\n```\n\\*\n\n\tCommand interface needs to be implemented for a runnable plugin of `cf`\n\n\\*\n\n```go\ntype PluginMetadata struct {\n\tName           string\n\tVersion        VersionType\n\tLibraryVersion VersionType\n\tMinCliVersion  VersionType\n\tCommands       []Command\n}\n```\n\n```go\ntype Usage struct {\n\tUsage   string\n\tOptions map[string]string\n}\n```\n\n```go\ntype VersionType struct {\n\tMajor int\n\tMinor int\n\tBuild int\n}\n```\n\n","path":"github.com/DaAlbrecht/cf-cli/plugin","name":"plugin","synopsis":"","isRedistributable":true}
