package plugins
import "github.com/open-policy-agent/opa/plugins"
Package plugins implements plugin management for the policy engine.
Index ¶
- type Manager
- func New(config []byte, id string, store storage.Store) (*Manager, error)
- func (m *Manager) Client(name string) rest.Client
- func (m *Manager) GetCompiler() *ast.Compiler
- func (m *Manager) Register(plugin Plugin)
- func (m *Manager) RegisterCompilerTrigger(f func(txn storage.Transaction))
- func (m *Manager) Services() []string
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop(ctx context.Context)
- type Plugin
- type PluginInitFunc
Types ¶
type Manager ¶
type Manager struct { Labels map[string]string Store storage.Store // contains filtered or unexported fields }
Manager implements lifecycle management of plugins and gives plugins access to engine-wide components like storage.
func New ¶
New creates a new Manager using config.
func (*Manager) Client ¶
Client returns a client for communicating with a remote service.
func (*Manager) GetCompiler ¶
GetCompiler returns the manager's compiler.
func (*Manager) Register ¶
Register adds a plugin to the manager. When the manager is started, all of the plugins will be started.
func (*Manager) RegisterCompilerTrigger ¶
func (m *Manager) RegisterCompilerTrigger(f func(txn storage.Transaction))
RegisterCompilerTrigger registers for change notifications when the compiler is changed.
func (*Manager) Services ¶
Services returns a list of services that m can provide clients for.
func (*Manager) Start ¶
Start starts the manager.
func (*Manager) Stop ¶
Stop stops the manager, stopping all the plugins registered with it
type Plugin ¶
Plugin defines the interface for OPA plugins.
type PluginInitFunc ¶
PluginInitFunc defines the interface for the constructing plugins from configuration. The function will be called with the plugin manager (which provides access to OPA's storage layer, compiler, and service clients) and the configuration for the plugin itself.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
plugins/bundle | Package bundle implements bundle downloading. |
plugins/logs | Package logs implements decision log buffering and uploading. |
plugins/rest | Package rest implements a REST client for communicating with remote services. |
plugins/status | Package status implements status reporting. |
- Version
- v0.9.2
- Published
- Sep 24, 2018
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 12 minutes ago –
Tools for package owners.