Documentation
¶
Index ¶
- Constants
- func ConfigurePlugin(ctx context.Context, configurer Configurer, dataSource DataSource, ...) (string, error)
- func ReconfigureOnSignal(ctx context.Context, log *slog.Logger, reconfigurer Reconfigurer) error
- func ReconfigureTask(log *slog.Logger, reconfigurer Reconfigurer) func(context.Context) error
- func WithPluginName(ctx context.Context, name string) context.Context
- type Build
- type BuiltInPlugin
- type BuiltInPluginRegistry
- type BuiltInPluginRetriever
- type Catalog
- type Config
- type Configurer
- type ConfigurerFunc
- type Configurers
- type DataSource
- type FileData
- type FixedData
- type HCPlugin
- type HCRPCPlugin
- type Plugin
- type PluginConfig
- type PluginConfigs
- type Reconfigurable
- type Reconfigurer
- type Reconfigurers
Constants ¶
View Source
const ( Name = "pluginName" Type = "pluginType" )
Variables ¶
This section is empty.
Functions ¶
func ConfigurePlugin ¶ added in v0.9.3
func ConfigurePlugin(ctx context.Context, configurer Configurer, dataSource DataSource, lastHash string) (string, error)
func ReconfigureOnSignal ¶ added in v0.9.3
func ReconfigureTask ¶ added in v0.9.3
Types ¶
type BuiltInPlugin ¶ added in v0.9.2
type BuiltInPlugin interface {
api.Info
Plugin() api.PluginServer
Services() []api.ServiceServer
}
func MakeBuiltIn ¶ added in v0.2.0
func MakeBuiltIn(name string, pluginServer api.PluginServer, serviceServers ...api.ServiceServer) BuiltInPlugin
type BuiltInPluginRegistry ¶ added in v0.9.2
type BuiltInPluginRegistry interface {
BuiltInPluginRetriever
Register(plugin BuiltInPlugin)
}
func CreateBuiltInPluginRegistry ¶ added in v0.9.3
func CreateBuiltInPluginRegistry() BuiltInPluginRegistry
type BuiltInPluginRetriever ¶ added in v0.9.3
type BuiltInPluginRetriever interface {
Retrieve() []BuiltInPlugin
}
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.9.3
func New(ctx context.Context, config Config, repo api.Repository, builtIns ...BuiltInPlugin) (_ *Catalog, err error)
func (*Catalog) ListPluginInfo ¶ added in v0.9.1
func (*Catalog) LookupByType ¶
func (*Catalog) LookupByTypeAndName ¶
func (*Catalog) Reconfigure ¶ added in v0.9.3
type Config ¶
type Config struct {
// Logger is the logger. It is used for general purpose logging and also
// provided to the plugins.
Logger *slog.Logger
// PluginConfigs is the list of plugin configurations.
PluginConfigs []PluginConfig
// HostServices are the servers for host services provided by SPIRE to
// plugins.
HostServices []api.ServiceServer
}
type Configurer ¶ added in v0.9.3
type ConfigurerFunc ¶ added in v0.9.3
type Configurers ¶
type Configurers []*configurer
type DataSource ¶ added in v0.9.3
type HCRPCPlugin ¶
type HCRPCPlugin struct {
// HCRPCPlugin must implement the Plugin interface
goplugin.NetRPCUnsupportedPlugin
// contains filtered or unexported fields
}
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (*HCRPCPlugin) GRPCClient ¶
func (p *HCRPCPlugin) GRPCClient(ctx context.Context, b *goplugin.GRPCBroker, c *grpc.ClientConn) (any, error)
func (*HCRPCPlugin) GRPCServer ¶
func (p *HCRPCPlugin) GRPCServer(broker *goplugin.GRPCBroker, s *grpc.Server) error
type PluginConfig ¶
type PluginConfig struct {
// Name of the plugin
Name string
// Type is the plugin type
Type string
// Path is the path on disk to the plugin.
Path string
// Args are the command line arguments to supply to the plugin
Args []string
// Env is the environment variables to supply to the plugin
Env map[string]string
// Checksum is the hex-encoded SHA256 hash of the plugin binary.
Checksum string
Version uint32
DataSource DataSource
YamlConfiguration string
LogLevel string
Disabled bool
Logger *slog.Logger
HostServices []api.ServiceServer
// Tags are the metadata associated with a plugin these can be used to filter plugins later e.g. ['FeatureA'] on client side.
Tags []string
}
func (*PluginConfig) IsEnabled ¶ added in v0.2.0
func (c *PluginConfig) IsEnabled() bool
func (*PluginConfig) IsExternal ¶ added in v0.2.0
func (c *PluginConfig) IsExternal() bool
type PluginConfigs ¶
type PluginConfigs []PluginConfig
type Reconfigurable ¶ added in v0.9.3
type Reconfigurable struct {
Log *slog.Logger
Configurer Configurer
DataSource DataSource
LastHash string
}
func (*Reconfigurable) Reconfigure ¶ added in v0.9.3
func (r *Reconfigurable) Reconfigure(ctx context.Context)
type Reconfigurer ¶ added in v0.9.3
type Reconfigurers ¶ added in v0.9.3
type Reconfigurers []Reconfigurer
func (Reconfigurers) Reconfigure ¶ added in v0.9.3
func (rs Reconfigurers) Reconfigure(ctx context.Context)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
testplugin
command
This package implements a test plugin for go test.
|
This package implements a test plugin for go test. |
Click to show internal directories.
Click to hide internal directories.