sharedobj

package
v1.7.11 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompatiblePluginAPIVersion = "0.1.0"

CompatiblePluginAPIVersion indicates what matching API version an external plugin must have so that Secretless is capable of loading it.

Functions

func AllAvailablePlugins

func AllAvailablePlugins(
	pluginDir string,
	checksumsFile string,
	logger log.Logger,
) (plugin.AvailablePlugins, error)

AllAvailablePlugins returns the full list of internal and external plugins available to the broker.

func AllAvailablePluginsWithOptions

func AllAvailablePluginsWithOptions(
	pluginDir string,
	checksumsFile string,
	internalLookupFunc InternalPluginLookupFunc,
	externalLookupfunc ExternalPluginLookupFunc,
	logger log.Logger,
) (plugin.AvailablePlugins, error)

AllAvailablePluginsWithOptions returns the full list of internal and external plugins available to the broker using explicitly-defined lookup functions.

func ExternalPlugins

func ExternalPlugins(
	pluginDir string,
	checksumsFile string,
	logger log.Logger,
) (plugin2.AvailablePlugins, error)

ExternalPlugins is used to enumerate all externally-available plugins in a given directory.

func ExternalPluginsWithOptions added in v1.3.0

func ExternalPluginsWithOptions(
	pluginDir string,
	checksumsFile string,
	getRawPlugins DirectoryPluginLookupFunc,
	logger log.Logger,
) (plugin2.AvailablePlugins, error)

ExternalPluginsWithOptions is used to enumerate all externally-available plugins in a specified directory to the clients of this method with the additional option of being able to specify the lookup function.

func GetInternalPluginsFunc

func GetInternalPluginsFunc() (plugin.AvailablePlugins, error)

GetInternalPluginsFunc returns currently available built-in plugins.

func InternalPlugins

func InternalPlugins(lookupFunc InternalPluginLookupFunc) (plugin.AvailablePlugins, error)

InternalPlugins is used to enumerate built-in plugins.

func IsHTTPPlugin

func IsHTTPPlugin(availPlugins plugin.AvailablePlugins, pluginID string) bool

IsHTTPPlugin uses AvailablePlugins to determine if a pluginId is an HTTP plugin.

func VerifyPluginChecksums

func VerifyPluginChecksums(pluginDir string, checksumsFile string) ([]os.FileInfo, error)

VerifyPluginChecksums verifies all plugin files, and returns the FileInfo for the verified files.

Types

type DirectoryPluginLookupFunc added in v1.3.0

type DirectoryPluginLookupFunc func(
	pluginDir string,
	checksumfile string,
	logger log.Logger,
) (map[string]rawPlugin, error)

DirectoryPluginLookupFunc returns all available external plugins.

type ExternalPluginLookupFunc

type ExternalPluginLookupFunc func(
	pluginDir string,
	checksumfile string,
	logger log.Logger,
) (plugin2.AvailablePlugins, error)

ExternalPluginLookupFunc returns all available external plugins.

type InternalPluginLookupFunc

type InternalPluginLookupFunc func() (plugin.AvailablePlugins, error)

InternalPluginLookupFunc returns all available buiilt-in plugins.

type Plugins

type Plugins struct {
	HTTPPluginsByID map[string]http.Plugin
	TCPPluginsByID  map[string]tcp.Plugin
}

Plugins represent a holding object for a bundle of plugins of different types.

func NewPlugins added in v1.3.0

func NewPlugins() Plugins

NewPlugins plugins creates a new instance of Plugins with both maps initialized but empty.

func (*Plugins) HTTPPlugins

func (plugins *Plugins) HTTPPlugins() map[string]http.Plugin

HTTPPlugins returns only the HTTP plugins in the Plugins struct.

func (*Plugins) TCPPlugins

func (plugins *Plugins) TCPPlugins() map[string]tcp.Plugin

TCPPlugins returns only the TCP plugins in the Plugins struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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