plugins

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandPathToString

func CommandPathToString(path []string) string

func NewPlugin

func NewPlugin(c *cobra.Command, p []string, options ...PluginOption) *plugin

Types

type CommandProvider

type CommandProvider interface {
	GetCommand([]string) *cobra.Command
}

type Plugin

type Plugin interface {
	GetCommand() *cobra.Command
	GetCommandPath() []string
	Init(CommandProvider) error
	GetServiceAssociated() string
}

Plugin interface represents the functionality that plugins can provide.

type PluginOption

type PluginOption func(*plugin) error

func AssociateService

func AssociateService(service string) PluginOption

Use this to associate a plugin with a service. So if failed to load service, this plugin won't load. A plugin is considerated Service associated if get a service command and modify its behaviour

Directories

Path Synopsis
rsa

Jump to

Keyboard shortcuts

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