opa

package
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUndefinedErr

func IsUndefinedErr(err error) bool

IsUndefinedErr returns true if the err represents an undefined result from OPA.

Types

type Client

type Client interface {
	Policies
	Data
}

Client defines the OPA client interface.

func New

func New(url string, auth string) Client

New returns a new Client object.

type Data

type Data interface {
	Prefix(path string) Data
	PatchData(path string, op string, value *interface{}) error
	PutData(path string, value interface{}) error
	PostData(path string, value interface{}) (json.RawMessage, error)
}

Data defines the interface for pushing and querying data in OPA.

type Error

type Error struct {
	Code    string          `json:"code"`
	Message string          `json:"message"`
	Errors  json.RawMessage `json:"errors,omitempty"`
}

Error contains the standard error fields returned by OPA.

func (*Error) Error

func (err *Error) Error() string

type Policies

type Policies interface {
	InsertPolicy(id string, bs []byte) error
	DeletePolicy(id string) error
}

Policies defines the policy management interface in OPA.

type Undefined

type Undefined struct{}

Undefined represents an undefined response from OPA.

func (Undefined) Error

func (Undefined) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL