mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
a179a24c48
All packages, except for `cmd` and `internal`, have been moved into a new `v1` root package. Old packages are kept for backwards-compatibility reasons. All contained code is replaced with simple type aliases and proxy functions to `v1` implementations. Old packages default to the Rego v0 syntax, new `v1` packages default to the Rego v1 syntax. Signed-off-by: Johan Fylling <johan.dev@fylling.se>
32 lines
900 B
Go
32 lines
900 B
Go
// Copyright 2018 The OPA Authors. All rights reserved.
|
|
// Use of this source code is governed by an Apache2
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Package bundle implements bundle loading.
|
|
package bundle
|
|
|
|
import (
|
|
"github.com/open-policy-agent/opa/plugins"
|
|
v1 "github.com/open-policy-agent/opa/v1/plugins/bundle"
|
|
)
|
|
|
|
// Loader defines the interface that the bundle plugin uses to control bundle
|
|
// loading via HTTP, disk, etc.
|
|
type Loader = v1.Loader
|
|
|
|
// Plugin implements bundle activation.
|
|
type Plugin = v1.Plugin
|
|
|
|
// New returns a new Plugin with the given config.
|
|
func New(parsedConfig *Config, manager *plugins.Manager) *Plugin {
|
|
return v1.New(parsedConfig, manager)
|
|
}
|
|
|
|
// Name identifies the plugin on manager.
|
|
const Name = v1.Name
|
|
|
|
// Lookup returns the bundle plugin registered with the manager.
|
|
func Lookup(manager *plugins.Manager) *Plugin {
|
|
return v1.Lookup(manager)
|
|
}
|