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

package status

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

Package status implements status reporting.

Index

Package Files

plugin.go

Constants

const Name = "status"

Name identifies the plugin on manager.

type Config Uses

type Config struct {
    Service       string `json:"service"`
    PartitionName string `json:"partition_name,omitempty"`
    ConsoleLogs   bool   `json:"console"`
}

Config contains configuration for the plugin.

func ParseConfig Uses

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

ParseConfig validates the config and injects default values.

type Plugin Uses

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

Plugin implements status reporting. Updates can be triggered by the caller.

func Lookup Uses

func Lookup(manager *plugins.Manager) *Plugin

Lookup returns the status plugin registered with the manager.

func New Uses

func New(parsedConfig *Config, manager *plugins.Manager) *Plugin

New returns a new Plugin with the given config.

func (*Plugin) BulkUpdateBundleStatus Uses

func (p *Plugin) BulkUpdateBundleStatus(status map[string]*bundle.Status)

BulkUpdateBundleStatus notifies the plugin that the policy bundle was updated.

func (*Plugin) Reconfigure Uses

func (p *Plugin) Reconfigure(_ context.Context, config interface{})

Reconfigure notifies the plugin with a new configuration.

func (*Plugin) Start Uses

func (p *Plugin) Start(ctx context.Context) error

Start starts the plugin.

func (*Plugin) Stop Uses

func (p *Plugin) Stop(ctx context.Context)

Stop stops the plugin.

func (*Plugin) UpdateBundleStatus Uses

func (p *Plugin) UpdateBundleStatus(status bundle.Status)

UpdateBundleStatus notifies the plugin that the policy bundle was updated. Deprecated: Use BulkUpdateBundleStatus instead.

func (*Plugin) UpdateDiscoveryStatus Uses

func (p *Plugin) UpdateDiscoveryStatus(status bundle.Status)

UpdateDiscoveryStatus notifies the plugin that the discovery bundle was updated.

func (*Plugin) UpdatePluginStatus Uses

func (p *Plugin) UpdatePluginStatus(status map[string]*plugins.Status)

UpdatePluginStatus notifies the plugin that a plugin status was updated.

func (*Plugin) WithMetrics Uses

func (p *Plugin) WithMetrics(m metrics.Metrics) *Plugin

WithMetrics sets the global metrics provider to be used by the plugin.

type UpdateRequestV1 Uses

type UpdateRequestV1 struct {
    Labels    map[string]string          `json:"labels"`
    Bundle    *bundle.Status             `json:"bundle,omitempty"` // Deprecated: Use bulk `bundles` status updates instead
    Bundles   map[string]*bundle.Status  `json:"bundles,omitempty"`
    Discovery *bundle.Status             `json:"discovery,omitempty"`
    Metrics   map[string]interface{}     `json:"metrics,omitempty"`
    Plugins   map[string]*plugins.Status `json:"plugins,omitempty"`
}

UpdateRequestV1 represents the status update message that OPA sends to remote HTTP endpoints.

Package status imports 11 packages (graph) and is imported by 4 packages. Updated 2020-02-07. Refresh now. Tools for package owners.