package server

import "github.com/open-policy-agent/opa/server"

Package server contains the policy engine's server handlers.

Index

Constants

const (
	// ParamRequestV1 defines the name of the HTTP URL parameter that specifies
	// values for the "request" document.
	ParamRequestV1 = "request"
)

Functions

func IsWriteConflict

func IsWriteConflict(err error) bool

IsWriteConflict returns true if the error indicates write conflict.

Types

type Server

type Server struct {
	Handler http.Handler
	// contains filtered or unexported fields
}

Server represents an instance of OPA running in server mode.

func New

func New(ctx context.Context, store *storage.Storage, addr string, persist bool) (*Server, error)

New returns a new Server.

func (*Server) Compiler

func (s *Server) Compiler() *ast.Compiler

Compiler returns the server's compiler.

The server's compiler contains the compiled versions of all modules added to the server as well as data structures for performing query analysis. This is intended to allow services to embed the OPA server while still relying on the topdown package for query evaluation.

func (*Server) Loop

func (s *Server) Loop() error

Loop starts the server. This function does not return.

type WriteConflictError

type WriteConflictError struct {
	// contains filtered or unexported fields
}

WriteConflictError represents an error condition raised if the caller attempts to modify a virtual document or create a document at a path that conflicts with an existing document.

func (WriteConflictError) Error

func (err WriteConflictError) Error() string

Source Files

doc.go server.go

Version
v0.3.1
Published
Dec 23, 2016
Platform
js/wasm
Imports
18 packages
Last checked
1 hour ago

Tools for package owners.