catalog

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Name = "pluginName"
	Type = "pluginType"
)

Variables

This section is empty.

Functions

func WithPluginName

func WithPluginName(ctx context.Context, name string) context.Context

Types

type Build added in v0.9.1

type Build interface {
	SetValue(string)
}

type BuiltInPlugin added in v0.9.2

type BuiltInPlugin interface {
	PluginInfo

	Plugin() api.PluginServer
	Services() []api.ServiceServer
}

func AsBuiltIn added in v0.9.2

func AsBuiltIn(name string, pluginServer api.PluginServer, serviceServers ...api.ServiceServer) BuiltInPlugin

type BuiltInPluginRegistry added in v0.9.2

type BuiltInPluginRegistry interface {
	Register(plugin BuiltInPlugin)
	Get() []BuiltInPlugin
}

func DefaultBuiltInPluginRegistry added in v0.9.2

func DefaultBuiltInPluginRegistry() BuiltInPluginRegistry

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

func Load

func Load(ctx context.Context, config Config, builtIns ...BuiltInPlugin) (catalog *Catalog, err error)

func (*Catalog) Close

func (c *Catalog) Close() error

func (*Catalog) ListPluginInfo added in v0.9.1

func (c *Catalog) ListPluginInfo() []PluginInfo

func (*Catalog) LookupByType

func (c *Catalog) LookupByType(pluginType string) []Plugin

func (*Catalog) LookupByTypeAndName

func (c *Catalog) LookupByTypeAndName(pluginType, pluginName string) Plugin

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 Configurers

type Configurers []*configurer

type HCPlugin

type HCPlugin struct {
	// contains filtered or unexported fields
}

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 Plugin

type Plugin interface {
	io.Closer

	ClientConnection() grpc.ClientConnInterface
	Info() PluginInfo
	Logger() *slog.Logger
	GrpcServiceNames() []string
}

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

	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 PluginInfo

type PluginInfo interface {
	// The name of the plugin
	Name() string

	// The type of the plugin
	Type() string

	// Tags associated with the plugin
	Tags() []string

	// Build of the plugin
	Build() string
}

PluginInfo provides the information for the loaded plugin.

Directories

Path Synopsis
internal
testplugin command
This package implements a test plugin for go test.
This package implements a test plugin for go test.

Jump to

Keyboard shortcuts

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