remote

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(auth string) arg

func IsUndefinedErr

func IsUndefinedErr(err error) bool

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

func New

func New(args ...arg) (drivers.Driver, error)

func OpaCA

func OpaCA(ca *x509.CertPool) arg

func Tracing

func Tracing(enabled bool) arg

func URL

func URL(url string) arg

Types

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)
	DeleteData(path string) error
	Query(path string, value interface{}) (*QueryResult, error)
}

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

type Error

type Error struct {
	Status  int
	Message string
}

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
	ListPolicies() (*QueryResult, error)
}

Policies defines the policy management interface in OPA.

type QueryResult

type QueryResult struct {
	Explanation json.RawMessage        `json:"explanation,omitempty"`
	Result      json.RawMessage        `json:"result"`
	Error       map[string]interface{} `json:"error"`
}

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