catalog

package
v0.0.0-...-b25b198 Latest Latest
Warning

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

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

Documentation

Overview

Package catalog implements catalog management functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanCatalogCache

func CleanCatalogCache() error

CleanCatalogCache cleans the catalog cache

func PluginNameTarget

func PluginNameTarget(pluginName string, target cliv1alpha1.Target) string

func UpdateCatalogCache

func UpdateCatalogCache() error

UpdateCatalogCache when updating the core CLI from v0.x.x to v1.x.x. This is needed to group the standalone plugins by context type.

Types

type Catalog

type Catalog interface {
	// Upsert inserts/updates the given plugin.
	Upsert(plugin cliapi.PluginDescriptor)

	// Get looks up the descriptor of a plugin given its name.
	Get(pluginName string) (cliapi.PluginDescriptor, bool)

	// List returns the list of active plugins.
	// Active plugin means the plugin that are available to the user
	// based on the current logged-in server.
	List() []cliapi.PluginDescriptor

	// Delete deletes the given plugin from the catalog, but it does not delete the installation.
	Delete(plugin string)
}

Catalog is the interface that maintains an index of the installed plugins as well as the active plugins.

type ContextCatalog

type ContextCatalog struct {
	// contains filtered or unexported fields
}

ContextCatalog denotes a local plugin catalog for a given context or stand-alone.

func NewContextCatalog

func NewContextCatalog(context string) (*ContextCatalog, error)

NewContextCatalog creates context-aware catalog

func (*ContextCatalog) Delete

func (c *ContextCatalog) Delete(plugin string) error

Delete deletes the given plugin from the catalog, but it does not delete the installation.

func (*ContextCatalog) Get

func (c *ContextCatalog) Get(plugin string) (cliapi.PluginDescriptor, bool)

Get looks up the descriptor of a plugin given its name.

func (*ContextCatalog) List

List returns the list of active plugins. Active plugin means the plugin that are available to the user based on the current logged-in server.

func (*ContextCatalog) Upsert

func (c *ContextCatalog) Upsert(plugin *cliapi.PluginDescriptor) error

Upsert inserts/updates the given plugin.

Jump to

Keyboard shortcuts

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