plugin

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginFilenamePrefix = "cbctl"
	PluginDirectory      = "plugins"
)

Variables

This section is empty.

Functions

func HandlePluginCommand

func HandlePluginCommand(pluginHandler PluginHandler, cmdArgs []string) error

func NewCommandPlugin

func NewCommandPlugin(options *app.Options) *cobra.Command

returns a cobra command

Types

type CommandOverrideVerifier

type CommandOverrideVerifier struct {
	// contains filtered or unexported fields
}

func (*CommandOverrideVerifier) Verify

func (v *CommandOverrideVerifier) Verify(path string) []error

implements PathVerifier and determines if a given path

type DefaultPluginHandler

type DefaultPluginHandler struct {
	// contains filtered or unexported fields
}

func NewDefaultPluginHandler

func NewDefaultPluginHandler() *DefaultPluginHandler

func (*DefaultPluginHandler) Execute

func (h *DefaultPluginHandler) Execute(executablePath string, cmdArgs, environment []string) error

func (*DefaultPluginHandler) Lookup

func (h *DefaultPluginHandler) Lookup(filename string) (string, bool)

type PathVerifier

type PathVerifier interface {
	Verify(path string) []error
}

type PluginHandler

type PluginHandler interface {
	Lookup(filename string) (string, bool)
	Execute(executablePath string, cmdArgs, environment []string) error
}

type PluginOptions

type PluginOptions struct {
	*app.Options
	PluginPaths []string
	NameOnly    bool
	Verifier    PathVerifier
	// contains filtered or unexported fields
}

a struct to support command

func (*PluginOptions) Run

func (o *PluginOptions) Run() error

Jump to

Keyboard shortcuts

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