catalog

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithPluginName

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

Types

type Catalog

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

func Load

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

func (*Catalog) Close

func (c *Catalog) Close() error

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 struct {
	// contains filtered or unexported fields
}

func (*Plugin) ClientConnection

func (p *Plugin) ClientConnection() grpc.ClientConnInterface

func (Plugin) Close

func (cs Plugin) Close() error

Close closes all closers in the group in reverse order.

func (*Plugin) GrpcServiceNames

func (p *Plugin) GrpcServiceNames() []string

func (*Plugin) Info

func (p *Plugin) Info() PluginInfo

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
}

type PluginConfigs

type PluginConfigs []PluginConfig

type PluginInfo

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

	// The type of the plugin
	Type() 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