plugin

package
v0.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FSCacheRootDir = "/home/uipluginoperator/cache"

	// Cache states used by custom resources
	Cached   = "cached"
	Disabled = "disabled"
	Pending  = "pending"
)
View Source
const (
	FilesTxtFilename = "files.txt"
)

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) Save

func (c *FSCache) Save(name, version string) error

Save takes in the name and version of a plugin and creates an entry for it in the filesystem cache

func (*FSCache) Sync

func (c *FSCache) Sync(namespace string, cache plugincontroller.UIPluginCache) error

Sync takes in a UIPluginCache object and syncs the filesystem cache with it

type SafeIndex

type SafeIndex struct {
	Entries map[string]*v1.UIPluginEntry
	// contains filtered or unexported fields
}

func (*SafeIndex) Generate

func (s *SafeIndex) Generate(namespace string, cache plugincontroller.UIPluginCache) error

Generate generates a new index from a UIPluginCache object

func (*SafeIndex) SyncWithFsCache

func (s *SafeIndex) SyncWithFsCache() error

SyncWithFsCache 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

Jump to

Keyboard shortcuts

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