Documentation ¶
Overview ¶
Package registry provides plugins functionalities for cobra cli application.
Index ¶
- type FsRegistry
- func (r *FsRegistry) Config() (config.Configuration, error)
- func (r *FsRegistry) Disable(name string) error
- func (r *FsRegistry) Enable(name string) error
- func (r *FsRegistry) GetPlugin(name string) (*plugin.Plugin, error)
- func (r *FsRegistry) Install(ctx context.Context, src string) error
- func (r *FsRegistry) Uninstall(name string) error
- type Option
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FsRegistry ¶
type FsRegistry struct {
// contains filtered or unexported fields
}
FsRegistry is a file system plugin registry.
func NewRegistry ¶
func NewRegistry(path string, options ...Option) (*FsRegistry, error)
NewRegistry initiates a new plugin registry.
func (*FsRegistry) Config ¶
func (r *FsRegistry) Config() (config.Configuration, error)
Config returns the configuration of the registry.
func (*FsRegistry) Disable ¶
func (r *FsRegistry) Disable(name string) error
Disable disables a plugin by name.
func (*FsRegistry) Enable ¶
func (r *FsRegistry) Enable(name string) error
Enable enabled a plugin by name.
func (*FsRegistry) GetPlugin ¶ added in v0.1.4
func (r *FsRegistry) GetPlugin(name string) (*plugin.Plugin, error)
GetPlugin gets plugin by name.
func (*FsRegistry) Install ¶
func (r *FsRegistry) Install(ctx context.Context, src string) error
Install installs plugin from a url.
func (*FsRegistry) Uninstall ¶
func (r *FsRegistry) Uninstall(name string) error
Uninstall uninstalls a plugin.
type Option ¶
type Option func(r *FsRegistry)
Option configures Registry.
func WithConfigFile ¶
WithConfigFile sets config file location.
func WithConfigurator ¶
func WithConfigurator(c config.Configurator) Option
WithConfigurator sets configurator.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package config provides functionalities for configuring the plugins.
|
Package config provides functionalities for configuring the plugins. |
Package context provides context-services.
|
Package context provides context-services. |
Package installer provides contracts to define a new installer.
|
Package installer provides contracts to define a new installer. |
mock
|
|
configurator
Package configurator provide New functionalities for configurator.
|
Package configurator provide New functionalities for configurator. |
installer
Package installer provides mock for installer.
|
Package installer provides mock for installer. |
registry
Package registry provides mock for Registry.
|
Package registry provides mock for Registry. |
Package plugin provides functionalities for reading plugin configuration.
|
Package plugin provides functionalities for reading plugin configuration. |
Click to show internal directories.
Click to hide internal directories.