catalog

package
v0.9.6 Latest Latest
Warning

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

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

Documentation

Index

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 ReconfigureOnSignal(ctx context.Context, log *slog.Logger, reconfigurer Reconfigurer) error

func ReconfigureTask added in v0.9.3

func ReconfigureTask(log *slog.Logger, reconfigurer Reconfigurer) func(context.Context) error

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 {
	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) Close

func (c *Catalog) Close() error

func (*Catalog) ListPluginInfo added in v0.9.1

func (c *Catalog) ListPluginInfo() []api.Info

func (*Catalog) LookupByType

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

func (*Catalog) LookupByTypeAndName

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

func (*Catalog) Reconfigure added in v0.9.3

func (c *Catalog) Reconfigure(ctx context.Context)

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 Configurer interface {
	Configure(ctx context.Context, configuration string) error
}

type ConfigurerFunc added in v0.9.3

type ConfigurerFunc func(ctx context.Context, configuration string) error

func (ConfigurerFunc) Configure added in v0.9.3

func (fn ConfigurerFunc) Configure(ctx context.Context, configuration string) error

type Configurers

type Configurers []*configurer

type DataSource added in v0.9.3

type DataSource interface {
	Load() (string, error)
	IsDynamic() bool
}

type FileData added in v0.9.3

type FileData string

func (FileData) IsDynamic added in v0.9.3

func (d FileData) IsDynamic() bool

func (FileData) Load added in v0.9.3

func (d FileData) Load() (string, error)

type FixedData added in v0.9.3

type FixedData string

func (FixedData) IsDynamic added in v0.9.3

func (d FixedData) IsDynamic() bool

func (FixedData) Load added in v0.9.3

func (d FixedData) Load() (string, error)

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() api.Info
	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

	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 Reconfigurer interface {
	Reconfigure(ctx context.Context)
}

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)

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