opa: github.com/open-policy-agent/opa/plugins/discovery Index | Files

package discovery

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

Package discovery implements configuration discovery.


Package Files

config.go discovery.go


const Name = "discovery"

Name is the discovery plugin name that will be registered with the plugin manager.

func Factories Uses

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

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

func Metrics Uses

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

Metrics provides a metrics provider to pass to plugins.

type Config Uses

type Config struct {
    download.Config         // bundle downloader configuration
    Name            *string `json:"name"`               // name of the discovery bundle
    Prefix          *string `json:"prefix,omitempty"`   // Deprecated: use `Resource` instead.
    Decision        *string `json:"decision"`           // the name of the query to run on the bundle to get the config
    Service         string  `json:"service"`            // the name of the service used to download discovery bundle from
    Resource        *string `json:"resource,omitempty"` // the resource path which will be downloaded from the service
    // contains filtered or unexported fields

Config represents the configuration for the discovery feature.

func ParseConfig Uses

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

ParseConfig returns a valid Config object with defaults injected.

type Discovery Uses

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 Uses

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

New returns a new discovery plugin.

func (*Discovery) Reconfigure Uses

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

Reconfigure is a no-op on discovery.

func (*Discovery) Start Uses

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

Start starts the dynamic discovery process if configured.

func (*Discovery) Stop Uses

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

Stop stops the dynamic discovery process if configured.

Package discovery imports 18 packages (graph) and is imported by 2 packages. Updated 2020-02-07. Refresh now. Tools for package owners.