pluginset

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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