Help us shape the future of Go! Take the 2026 Go Developer Survey

pluginset

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package pluginset derives the plugins implied by an OPA configuration, split into those needing a start and those needing a reconfigure. Shared by the discovery plugin and the runtime's configuration file reloading.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configs

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

Configs holds the plugin configurations a configuration enables. Deriving them registers nothing, so a caller can validate a configuration before any plugin has been created.

func Parse

func Parse(
	factories map[string]plugins.Factory,
	manager *plugins.Manager,
	config *config.Config,
	m metrics.Metrics,
	l logging.Logger,
	trigger *plugins.TriggerMode,
) (*Configs, error)

Parse validates config against the services and keys registered on manager, and derives the plugin configurations it enables, without touching the manager.

func (*Configs) Set

func (c *Configs) Set(manager *plugins.Manager) *Set

Set registers any plugin these configurations enable that isn't registered yet, and returns the plugins to start and reconfigure.

type Reconfig

type Reconfig struct {
	Config any
	Plugin plugins.Plugin
}

Reconfig pairs an already running plugin with its new configuration.

type Set

type Set struct {
	Start    []plugins.Plugin
	Reconfig []Reconfig
}

Set holds the plugins Configs.Set registered and that still need starting, and those already registered that need reconfiguring.

func New

func New(
	factories map[string]plugins.Factory,
	manager *plugins.Manager,
	config *config.Config,
	m metrics.Metrics,
	l logging.Logger,
	trigger *plugins.TriggerMode,
) (*Set, error)

New validates config and registers any plugin it enables that isn't registered yet. Plugins config no longer enables are left running as-is.

func (*Set) Apply

func (s *Set) Apply(ctx context.Context) error

Apply starts the plugins that aren't running, then reconfigures the rest.

Jump to

Keyboard shortcuts

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