Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStripeCLIConfig ¶
GetStripeCLIConfig returns a pointer to the CLI config that plugins can reference.
func StartPlugin ¶
func StartPlugin(bc *Config, cmdExecute func(args []string, ctx context.Context) error, pluginRootCmd *cobra.Command, pluginInfo telemetry.PluginInfo) error
StartPlugin defines the interfaces for the plugin and then serves them over RPC The CLI can then interact with the plugin from there
Types ¶
type CommandInfo ¶
type CommandInfo struct {
Name string `toml:"Name" json:"name"`
Desc string `toml:"Desc" json:"desc,omitempty"`
Commands []CommandInfo `toml:"Command,omitempty" json:"commands,omitempty"`
}
CommandInfo describes a plugin subcommand for inclusion in the plugins.toml manifest. The CLI reads this metadata to display plugin subcommands in --map output and shell completion without launching the plugin binary.
func ExtractCommandTree ¶
func ExtractCommandTree(cmd *cobra.Command) []CommandInfo
ExtractCommandTree walks a cobra.Command tree and returns a slice of CommandInfo suitable for serialization into a plugins.toml manifest. Hidden commands, deprecated commands, and the auto-generated "help" command are excluded.
type PluginImpl ¶
type PluginImpl struct {
// contains filtered or unexported fields
}
func (*PluginImpl) RunCommand ¶
func (g *PluginImpl) RunCommand(args []string) (string, error)
type PluginImplGRPC ¶
type PluginImplGRPC struct {
}
func (*PluginImplGRPC) RunCommand ¶
func (p *PluginImplGRPC) RunCommand(additionalInfo *proto.AdditionalInfo, args []string) error