hub

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 6 Imported by: 1

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPlugin

func GetPlugin(v string) (kit.Plugin, error)

GetPluginDetail returns Plugin of specific plugin version.

func GetPluginVersions

func GetPluginVersions() []string

GetPluginVersions returns the versions of intalled plugin instance in new to old order.

func MustInstall

func MustInstall(p kit.Plugin, contextInputs interface{}, outputs interface{}, InputsForm []byte)

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.

Jump to

Keyboard shortcuts

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