plugin

package
v0.0.0-...-0fefa07 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LoadPath is an OS-specific list of directories to search for plugins
	LoadPath string
	// LoadEnv is the name of the environment variable to retrieve the LoadPath
	LoadEnv string
)

Functions

func NewDefaultPlugin

func NewDefaultPlugin() crypto.EncrypterPlugin

Types

type PKCS7EncryptionPlugin

type PKCS7EncryptionPlugin struct {
	*pkcs7.PKCS7Plugin `kong:"embed,group='encryption',prefix='pkcs7.'"`
}

PKCS7EncryptionPlugin is a CLI argument container

func (*PKCS7EncryptionPlugin) Encrypter

func (b *PKCS7EncryptionPlugin) Encrypter() string

func (*PKCS7EncryptionPlugin) NewEncrypter

func (b *PKCS7EncryptionPlugin) NewEncrypter(configDir string) (crypto.Encrypter, error)

type Plugin

type Plugin struct {
	crypto.EncrypterPlugin `kong:"embed,group='encryption',prefix='plugin.'"`
	// contains filtered or unexported fields
}

Plugin is a crypto.EncrypterPlugin implementation using an dynamically loaded implementation.

func (Plugin) String

func (p Plugin) String() string

String returns the filesystem location the plugin was loaded from

type PluginLoader

type PluginLoader string

PluginLoader is a wrapper around the golang plugin system to create crypto.EncrypterPlugin instances

func (PluginLoader) LoadDirsPlugins

func (l PluginLoader) LoadDirsPlugins(dirs []string) ([]Plugin, error)

LoadDirsPlugins searches for plugins in the given directories

func (PluginLoader) LoadEnvPlugins

func (l PluginLoader) LoadEnvPlugins(key, fallback string) ([]Plugin, error)

LoadEnvPlugins searches for plugins in locations designated by the given environment variable. The value is expected to be a list of directories. The item delimiter is OS-specific (os.PathListSeparator)

func (PluginLoader) LoadOsPlugins

func (l PluginLoader) LoadOsPlugins() ([]Plugin, error)

LoadOsPlugins searches for plugins in OS-specific locations

func (PluginLoader) LoadPlugin

func (l PluginLoader) LoadPlugin(file string) (Plugin, error)

LoadPlugin uses the golang plugin system to create a Plugin instance.

func (PluginLoader) LoadPlugins

func (l PluginLoader) LoadPlugins(dir string) ([]Plugin, error)

LoadPlugins searches for plugins in the given directory

Jump to

Keyboard shortcuts

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