api

package
v1.24.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const PluginRepositoriesName = "plugin-repositories"

Variables

This section is empty.

Functions

func CategoriedPlugins

func CategoriedPlugins(plugins map[string]pluginmanager.Plugin) map[string]map[string][]PluginStatus

func Run

func Run(ctx context.Context, options *Options, cachedir string) error

func SortPluginStatusByName

func SortPluginStatusByName(list []PluginStatus)

Types

type BaseClient added in v1.24.1

type BaseClient struct {
	Server              string
	CompleteRequestFunc func(req *http.Request)
	ErrorDecodeFunc     func(resp *http.Response) error
	DataDecoderWrapper  func(data any) any
}

func (*BaseClient) Request added in v1.24.1

func (c *BaseClient) Request(ctx context.Context, method string, path string, queries map[string]string, data interface{}, into interface{}) error

type ClientOptions added in v1.23.2

type ClientOptions struct {
	Addr string `json:"addr,omitempty"`
}

func NewDefaultClientOptions added in v1.23.2

func NewDefaultClientOptions() *ClientOptions

type Options

type Options struct {
	Listen    string `json:"listen,omitempty"`
	Namespace string `json:"namespace,omitempty"`
}

func DefaultOptions

func DefaultOptions() *Options

type PluginStatus

type PluginStatus struct {
	Name               string         `json:"name"`
	Namespace          string         `json:"namespace"`
	Description        string         `json:"description"`
	InstalledVersion   string         `json:"installedVersion"`
	UpgradeableVersion string         `json:"upgradeableVersion"`
	AvailableVersions  []string       `json:"availableVersions"`
	Required           bool           `json:"required"`
	Enabled            bool           `json:"enabled"`
	Healthy            bool           `json:"healthy"`
	Message            string         `json:"message"`
	Values             map[string]any `json:"values"` // current installed version values
	// contains filtered or unexported fields
}

func ToViewPlugin

func ToViewPlugin(plugin pluginmanager.Plugin) PluginStatus

type PluginsAPI

type PluginsAPI struct {
	PM *pluginmanager.PluginManager
}

func NewPluginsAPI

func NewPluginsAPI(pm *pluginmanager.PluginManager) *PluginsAPI

func (*PluginsAPI) EnablePlugin

func (o *PluginsAPI) EnablePlugin(resp http.ResponseWriter, req *http.Request)

func (*PluginsAPI) GetPlugin

func (o *PluginsAPI) GetPlugin(resp http.ResponseWriter, req *http.Request)

func (*PluginsAPI) ListPlugins

func (o *PluginsAPI) ListPlugins(resp http.ResponseWriter, req *http.Request)

func (*PluginsAPI) RegisterRoute

func (o *PluginsAPI) RegisterRoute(rg *route.Group)

func (*PluginsAPI) RemovePlugin

func (o *PluginsAPI) RemovePlugin(resp http.ResponseWriter, req *http.Request)

func (*PluginsAPI) RepoAdd

func (o *PluginsAPI) RepoAdd(resp http.ResponseWriter, req *http.Request)

func (*PluginsAPI) RepoGet

func (o *PluginsAPI) RepoGet(resp http.ResponseWriter, req *http.Request)

func (*PluginsAPI) RepoList

func (o *PluginsAPI) RepoList(resp http.ResponseWriter, req *http.Request)

func (*PluginsAPI) RepoRemove

func (o *PluginsAPI) RepoRemove(resp http.ResponseWriter, req *http.Request)

func (*PluginsAPI) RepoUpdate

func (o *PluginsAPI) RepoUpdate(resp http.ResponseWriter, req *http.Request)

type PluginsClient added in v1.23.2

type PluginsClient struct {
	BaseClient
}

func NewPluginsClient added in v1.23.2

func NewPluginsClient(server string) (*PluginsClient, error)

func (*PluginsClient) CheckUpdate added in v1.23.2

func (c *PluginsClient) CheckUpdate(ctx context.Context) (map[string]pluginmanager.Plugin, error)

func (*PluginsClient) GetPluginVersion added in v1.23.2

func (c *PluginsClient) GetPluginVersion(ctx context.Context,
	name, version string,
	withSchema bool, withDpendeciesCheck bool,
) (*pluginmanager.PluginVersion, error)

func (*PluginsClient) Install added in v1.23.2

func (c *PluginsClient) Install(ctx context.Context, name string, version string, values map[string]any) error

func (*PluginsClient) ListPlugins added in v1.23.2

func (c *PluginsClient) ListPlugins(ctx context.Context) (map[string]pluginmanager.Plugin, error)

func (*PluginsClient) UnInstall added in v1.23.2

func (c *PluginsClient) UnInstall(ctx context.Context, name string) error

Jump to

Keyboard shortcuts

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