Documentation ¶
Overview ¶
Package status implements status reporting.
Index ¶
- Constants
- type Config
- type ConfigBuilder
- func (b *ConfigBuilder) Parse() (*Config, error)
- func (b *ConfigBuilder) WithBytes(config []byte) *ConfigBuilder
- func (b *ConfigBuilder) WithPlugins(plugins []string) *ConfigBuilder
- func (b *ConfigBuilder) WithServices(services []string) *ConfigBuilder
- func (b *ConfigBuilder) WithTriggerMode(trigger *plugins.TriggerMode) *ConfigBuilder
- type Logger
- type Plugin
- func (p *Plugin) BulkUpdateBundleStatus(status map[string]*bundle.Status)
- func (p *Plugin) Reconfigure(_ context.Context, config interface{})
- func (p *Plugin) Snapshot() *UpdateRequestV1
- func (p *Plugin) Start(ctx context.Context) error
- func (p *Plugin) Stop(ctx context.Context)
- func (p *Plugin) Trigger(ctx context.Context) error
- func (p *Plugin) UpdateBundleStatus(status bundle.Status)
- func (p *Plugin) UpdateDiscoveryStatus(status bundle.Status)
- func (p *Plugin) UpdatePluginStatus(status map[string]*plugins.Status)
- func (p *Plugin) WithMetrics(m metrics.Metrics) *Plugin
- type UpdateRequestV1
Constants ¶
const Name = "status"
Name identifies the plugin on manager.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Plugin *string `json:"plugin"` Service string `json:"service"` PartitionName string `json:"partition_name,omitempty"` ConsoleLogs bool `json:"console"` Prometheus bool `json:"prometheus"` Trigger *plugins.TriggerMode `json:"trigger,omitempty"` // trigger mode }
Config contains configuration for the plugin.
type ConfigBuilder ¶ added in v0.44.0
type ConfigBuilder struct {
// contains filtered or unexported fields
}
ConfigBuilder assists in the construction of the plugin configuration.
func NewConfigBuilder ¶ added in v0.44.0
func NewConfigBuilder() *ConfigBuilder
NewConfigBuilder returns a new ConfigBuilder to build and parse the plugin config.
func (*ConfigBuilder) Parse ¶ added in v0.44.0
func (b *ConfigBuilder) Parse() (*Config, error)
Parse validates the config and injects default values.
func (*ConfigBuilder) WithBytes ¶ added in v0.44.0
func (b *ConfigBuilder) WithBytes(config []byte) *ConfigBuilder
WithBytes sets the raw plugin config.
func (*ConfigBuilder) WithPlugins ¶ added in v0.44.0
func (b *ConfigBuilder) WithPlugins(plugins []string) *ConfigBuilder
WithPlugins sets the list of named plugins for status updates.
func (*ConfigBuilder) WithServices ¶ added in v0.44.0
func (b *ConfigBuilder) WithServices(services []string) *ConfigBuilder
WithServices sets the services that implement control plane APIs.
func (*ConfigBuilder) WithTriggerMode ¶ added in v0.44.0
func (b *ConfigBuilder) WithTriggerMode(trigger *plugins.TriggerMode) *ConfigBuilder
WithTriggerMode sets the plugin trigger mode.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin implements status reporting. Updates can be triggered by the caller.
func (*Plugin) BulkUpdateBundleStatus ¶ added in v0.13.0
BulkUpdateBundleStatus notifies the plugin that the policy bundle was updated.
func (*Plugin) Reconfigure ¶ added in v0.10.2
Reconfigure notifies the plugin with a new configuration.
func (*Plugin) Snapshot ¶ added in v0.44.0
func (p *Plugin) Snapshot() *UpdateRequestV1
Snapshot returns the current status.
func (*Plugin) Trigger ¶ added in v0.44.0
Trigger can be used to control when the plugin attempts to upload status in manual triggering mode.
func (*Plugin) UpdateBundleStatus ¶ added in v0.10.2
UpdateBundleStatus notifies the plugin that the policy bundle was updated. Deprecated: Use BulkUpdateBundleStatus instead.
func (*Plugin) UpdateDiscoveryStatus ¶ added in v0.10.2
UpdateDiscoveryStatus notifies the plugin that the discovery bundle was updated.
func (*Plugin) UpdatePluginStatus ¶ added in v0.44.0
UpdatePluginStatus notifies the plugin that a plugin status was updated.
type UpdateRequestV1 ¶
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.