Documentation
¶
Index ¶
- Variables
- func IsNotFoundError(err error) bool
- func NewPluginLoggers(bkLogger logrus.FieldLogger, pluginKey string, pluginType Type) (hclog.Logger, io.Writer, io.Writer)
- type Collector
- type Index
- type IndexBuilder
- type IndexEntry
- type IndexURL
- type IndexURLPlatform
- type Manager
- type NotFoundPluginError
- type Type
Constants ¶
This section is empty.
Variables ¶
var ErrNotStartedPluginManager = errors.New("plugin manager is not started yet")
ErrNotStartedPluginManager is an error returned when Plugin Manager was not yet started and initialized successfully.
Functions ¶
func IsNotFoundError ¶
IsNotFoundError returns true if one of the error in the chain is the not found error instance.
func NewPluginLoggers ¶
func NewPluginLoggers(bkLogger logrus.FieldLogger, pluginKey string, pluginType Type) (hclog.Logger, io.Writer, io.Writer)
NewPluginLoggers returns a copy of parent with a log settings dedicated for a given plugin. The log level is taken from the environment variable with a pattern: LOG_LEVEL_{pluginType}_{pluginRepo}_{pluginName}. If env variable is not set, default value is "info". Loggers: - hashicorp client logger always has the configured log level - binary standard output is logged only if debug level is set, otherwise it is discarded - binary standard error is logged always on error level
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector provides functionality to collect all enabled plugins based on the Botkube configuration.
func NewCollector ¶
func NewCollector(log logrus.FieldLogger) *Collector
NewCollector returns a new Collector instance.
type Index ¶
type Index struct {
Entries []IndexEntry `yaml:"entries"`
}
Index defines the plugin repository index.
type IndexBuilder ¶
type IndexBuilder struct {
// contains filtered or unexported fields
}
IndexBuilder provides functionality to generate plugin index.
func NewIndexBuilder ¶
func NewIndexBuilder(log logrus.FieldLogger) *IndexBuilder
NewIndexBuilder returns a new IndexBuilder instance.
type IndexEntry ¶
type IndexEntry struct {
Name string `yaml:"name"`
Type Type `yaml:"type"`
Description string `yaml:"description"`
Version string `yaml:"version"`
URLs []IndexURL `yaml:"urls"`
}
IndexEntry defines the plugin definition.
type IndexURL ¶
type IndexURL struct {
URL string `yaml:"url"`
Platform IndexURLPlatform `yaml:"platform"`
}
IndexURL holds the binary url details.
type IndexURLPlatform ¶
IndexURLPlatform holds platform information about a given binary URL.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides functionality for managing executor and source plugins.
func NewManager ¶
func NewManager(logger logrus.FieldLogger, cfg config.Plugins, executors, sources []string) *Manager
NewManager returns a new Manager instance.
func (*Manager) GetExecutor ¶
GetExecutor returns the executor client for a given plugin.
type NotFoundPluginError ¶
type NotFoundPluginError struct {
// contains filtered or unexported fields
}
NotFoundPluginError is an error returned when a given Plugin cannot be found in a given repository.
func NewNotFoundPluginError ¶
func NewNotFoundPluginError(msg string, args ...any) *NotFoundPluginError
NewNotFoundPluginError return a new NotFoundPluginError instance.
func (NotFoundPluginError) Error ¶
func (n NotFoundPluginError) Error() string
Error returns the error message.
func (*NotFoundPluginError) Is ¶
func (n *NotFoundPluginError) Is(target error) bool
Is returns true if target is not found error.