package discovery

import "github.com/open-policy-agent/opa/plugins/discovery"

Package discovery implements configuration discovery.

Index

Functions

func Factories

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

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

Types

type Config

type Config struct {
	download.Config         // bundle downloader configuration
	Name            *string `json:"name"`     // name of the discovery bundle
	Prefix          *string `json:"prefix"`   // path prefix for downloader
	Decision        *string `json:"decision"` // the name of the query to run on the bundle to get the config
	// contains filtered or unexported fields
}

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 Discovery

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

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

func New

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

New returns a new discovery plugin.

func (*Discovery) Reconfigure

func (c *Discovery) Reconfigure(_ context.Context, _ interface{})

Reconfigure is a no-op on discovery.

func (*Discovery) Start

func (c *Discovery) Start(ctx context.Context) error

Start starts the dynamic discovery process if configured.

func (*Discovery) Stop

func (c *Discovery) Stop(ctx context.Context)

Stop stops the dynamic discovery process if configured.

Source Files

config.go discovery.go

Version
v0.13.1
Published
Aug 14, 2019
Platform
js/wasm
Imports
16 packages
Last checked
3 minutes ago

Tools for package owners.