Documentation ¶
Overview ¶
Package plugins implements plugin management for the policy engine.
Index ¶
- func Info(term *ast.Term) func(*Manager)
- type Manager
- func (m *Manager) Client(name string) rest.Client
- func (m *Manager) GetCompiler() *ast.Compiler
- func (m *Manager) Labels() map[string]string
- func (m *Manager) Plugin(name string) Plugin
- func (m *Manager) Plugins() []string
- func (m *Manager) Reconfigure(config *config.Config) error
- func (m *Manager) Register(name string, 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct { Store storage.Store Config *config.Config Info *ast.Term ID string // contains filtered or unexported fields }
Manager implements lifecycle management of plugins and gives plugins access to engine-wide components like storage.
func (*Manager) GetCompiler ¶ added in v0.8.1
GetCompiler returns the manager's compiler.
func (*Manager) Plugin ¶ added in v0.10.2
Plugin returns the plugin registered with name or nil if name is not found.
func (*Manager) Plugins ¶ added in v0.10.2
Plugins returns the list of plugins registered with the manager.
func (*Manager) Reconfigure ¶ added in v0.10.2
Reconfigure updates the configuration on the manager.
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 ¶ added in v0.8.1
func (m *Manager) RegisterCompilerTrigger(f func(txn storage.Transaction))
RegisterCompilerTrigger registers for change notifications when the compiler is changed.
type Plugin ¶
type Plugin interface { Start(ctx context.Context) error Stop(ctx context.Context) Reconfigure(ctx context.Context, config interface{}) }
Plugin defines the interface for OPA plugins.
type PluginInitFunc ¶ added in v0.9.2
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.
Directories ¶
Path | Synopsis |
---|---|
Package bundle implements bundle downloading.
|
Package bundle implements bundle downloading. |
Package discovery implements configuration discovery.
|
Package discovery implements configuration discovery. |
Package logs implements decision log buffering and uploading.
|
Package logs implements decision log buffering and uploading. |
Package rest implements a REST client for communicating with remote services.
|
Package rest implements a REST client for communicating with remote services. |
Package status implements status reporting.
|
Package status implements status reporting. |