Documentation ¶
Overview ¶
Package hub implements a plugin hub. It provide the capability to:
1. install specific version to current bk-plugin project.
2. collect installed bk-plugin and it's meta data.
3. retrive information for specific version of bk-plugin.
Index ¶
- func GetPlugin(v string) (kit.Plugin, error)
- func GetPluginVersions() []string
- func MustInstall(p kit.Plugin, contextInputs interface{}, outputs interface{}, ...)
- type PluginDetail
- func (p *PluginDetail) ContextInputsSchema() []byte
- func (p *PluginDetail) ContextInputsSchemaJSON() map[string]interface{}
- func (p *PluginDetail) InputsSchemaJSON() map[string]interface{}
- func (p *PluginDetail) OutputsSchema() []byte
- func (p *PluginDetail) OutputsSchemaJSON() map[string]interface{}
- func (p *PluginDetail) Plugin() kit.Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPluginVersions ¶
func GetPluginVersions() []string
GetPluginVersions returns the versions of intalled plugin instance in new to old order.
func MustInstall ¶
MustInstall will install a version of plugin to hub.
The p is the plugin will be installed.
The inputs is inputs struct of this version, pass nil if this version do not have inputs.
The contextInputs is context inputs struct of this version, pass nil if this version do not have context inputs.
The outputs is outputs struct of this version, pass nil if this version do not have outputs.
The inputsForm is json schema form for inputs
Types ¶
type PluginDetail ¶
type PluginDetail struct {
// contains filtered or unexported fields
}
A PluginDetail store the detail data of specific plugin version.
func GetPluginDetail ¶
func GetPluginDetail(v string) (*PluginDetail, error)
GetPluginDetail returns PluginDetail of specific plugin version.
func (*PluginDetail) ContextInputsSchema ¶
func (p *PluginDetail) ContextInputsSchema() []byte
ContextInputsSchema returns the plugin context inputs json schema.
func (*PluginDetail) ContextInputsSchemaJSON ¶
func (p *PluginDetail) ContextInputsSchemaJSON() map[string]interface{}
ContextInputsSchemaJSON returns the unmarshaled plugin context inputs json schema.
func (*PluginDetail) InputsSchemaJSON ¶
func (p *PluginDetail) InputsSchemaJSON() map[string]interface{}
InputsSchemaJSON returns the unmarshaled plugin inputs json schema.
func (*PluginDetail) OutputsSchema ¶
func (p *PluginDetail) OutputsSchema() []byte
OutputsSchema returns the plugin outputs json schema.
func (*PluginDetail) OutputsSchemaJSON ¶
func (p *PluginDetail) OutputsSchemaJSON() map[string]interface{}
OutputsSchemaJSON returns the unmarshaled plugin outputs json schema.
func (*PluginDetail) Plugin ¶
func (p *PluginDetail) Plugin() kit.Plugin
Plugin returns the Plugin instance.