plugins

package
v0.0.0-...-d4f7748 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginRefreshKey = "PLUGIN_REFRESH"
	PluginListKey    = "PLUGIN_LIST"
)

Variables

This section is empty.

Functions

func Delete

func Delete(pluginDir, filename string) error

Delete deletes the plugin from the plugin directory.

func GeneratePluginPaths

func GeneratePluginPaths(staticPluginDir string, pluginDir string) ([]string, error)

GeneratePluginPaths takes the staticPluginDir and pluginDir and returns a list of plugin paths.

func HandlePluginEvents

func HandlePluginEvents(staticPluginDir, pluginDir string,
	notify <-chan string, cache cache.Cache[interface{}],
)

HandlePluginEvents handles the plugin events by updating the plugin list and plugin refresh key in the cache.

func HandlePluginReload

func HandlePluginReload(cache cache.Cache[interface{}], w http.ResponseWriter)

HandlePluginReload checks if the plugin refresh key is set to true and sends a signal to the frontend to reload the plugins by setting the X-Reload header to reload.

func PopulatePluginsCache

func PopulatePluginsCache(staticPluginDir, pluginDir string, cache cache.Cache[interface{}])

PopulatePluginsCache populates the plugin list and plugin refresh key in the cache.

func Watch

func Watch(path string, notify chan<- string)

Watch watches the given path for changes and sends the events to the notify channel.

Types

This section is empty.

Jump to

Keyboard shortcuts

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