discovery

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Overview

Package discovery implements configuration discovery.

Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/open-policy-agent/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.

Index

Constants

View Source
const (
	// Name is the discovery plugin name that will be registered with the plugin manager.
	Name = v1.Name
)

Variables

This section is empty.

Functions

func BootConfig added in v0.64.0

func BootConfig(bootConfig map[string]interface{}) func(*Discovery)

func Factories added in v0.10.3

func Factories(fs map[string]plugins.Factory) func(*Discovery)

Factories provides a set of factory functions to use for instantiating custom plugins.

func Hooks added in v0.54.0

func Hooks(hs hooks.Hooks) func(*Discovery)

func Metrics added in v0.14.0

func Metrics(m metrics.Metrics) func(*Discovery)

Metrics provides a metrics provider to pass to plugins.

Types

type Config

type Config = v1.Config

Config represents the configuration for the discovery feature.

func ParseConfig

func ParseConfig(bs []byte, services []string) (*Config, error)

ParseConfig returns a valid Config object with defaults injected.

type ConfigBuilder added in v0.22.0

type ConfigBuilder = v1.ConfigBuilder

ConfigBuilder assists in the construction of the plugin configuration.

func NewConfigBuilder added in v0.22.0

func NewConfigBuilder() *ConfigBuilder

NewConfigBuilder returns a new ConfigBuilder to build and parse the discovery config

type Discovery

type Discovery = v1.Discovery

Discovery implements configuration discovery for OPA. When discovery is started it will periodically download a configuration bundle and try to reconfigure the OPA.

func Lookup added in v0.32.0

func Lookup(manager *plugins.Manager) *Discovery

Lookup returns the discovery plugin registered with the manager.

func New

func New(manager *plugins.Manager, opts ...func(*Discovery)) (*Discovery, error)

New returns a new discovery plugin.

Jump to

Keyboard shortcuts

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