plugin

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FSCacheRootDir      = "/home/uipluginoperator/cache"
	FilesTxtFilename    = "files.txt"
	PackageJSONFilename = "plugin/package.json"

	// Cache states used by custom resources
	Cached   = "cached"
	Disabled = "disabled"
	Pending  = "pending"
)

Variables

View Source
var (
	FsCache = FSCache{}
)
View Source
var (
	Index = SafeIndex{}
)

Functions

func Register

func Register(
	ctx context.Context,
	systemNamespace, managedBy string,
	plugin plugincontroller.UIPluginController,
	pluginCache plugincontroller.UIPluginCache,
	k8s kubernetes.Interface,
)

Types

type FSCache

type FSCache struct{}

func (FSCache) Delete

func (c FSCache) Delete(name, version string) error

Delete takes in a plugin's name and version, and deletes its entry in the filesystem cache

func (FSCache) Save

func (c FSCache) Save(data []byte, path string) error

Save takes in data and a path to save it in the filesystem cache

func (FSCache) SyncWithControllersCache

func (c FSCache) SyncWithControllersCache(cachedPlugins []*v1.UIPlugin) error

SyncWithControllersCache takes in a slice of UI Plugins objects and syncs the filesystem cache with it

func (FSCache) SyncWithIndex

func (c FSCache) SyncWithIndex(index *SafeIndex, fsCacheFiles []string) error

SyncWithIndex syncs up entries in the filesystem cache with the index's entries Entries that aren't in the index, but present in the filesystem cache are deleted

type PackageJSON

type PackageJSON struct {
	Version string `json:"version,omitempty"`
}

type SafeIndex

type SafeIndex struct {
	Entries map[string]*v1.UIPluginEntry `json:"entries,omitempty"`
	// contains filtered or unexported fields
}

func (*SafeIndex) Generate

func (s *SafeIndex) Generate(cachedPlugins []*v1.UIPlugin) error

Generate generates a new index from a UIPluginCache object

Jump to

Keyboard shortcuts

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