package runtime
import "github.com/open-policy-agent/opa/runtime"
Index ¶
- func NewLoggingHandler(inner http.Handler) http.Handler
- type LoggingHandler
- type Params
- type Runtime
- type Server
Functions ¶
func NewLoggingHandler ¶
NewLoggingHandler returns a new http.Handler.
Types ¶
type LoggingHandler ¶
type LoggingHandler struct {
// contains filtered or unexported fields
}
LoggingHandler returns an http.Handler that will print log messages to glog containing the request information as well as response status and latency.
func (*LoggingHandler) ServeHTTP ¶
func (h *LoggingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Params ¶
type Params struct { // Addr is the listening address that the OPA server will bind to. Addr string // HistoryPath is the filename to store the interactive shell user // input history. HistoryPath string // Output format controls how the REPL will print query results. // Default: "pretty". OutputFormat string // Paths contains filenames of base documents and policy modules to // load on startup. Paths []string // PolicyDir is the filename of the directory to persist policy // definitions in. Policy definitions stored in this directory // are automatically loaded on startup. PolicyDir string // Server flag controls whether the OPA instance will start a server. // By default, the OPA instance acts as an interactive shell. Server bool }
Params stores the configuration for an OPA instance.
type Runtime ¶
type Runtime struct { DataStore *storage.DataStore PolicyStore *storage.PolicyStore }
Runtime represents a single OPA instance.
func (*Runtime) Init ¶
Init initializes the OPA instance.
func (*Runtime) Start ¶
Start is the entry point of an OPA instance.
type Server ¶
type Server struct { Addr string Persist bool Runtime *Runtime Router *mux.Router // contains filtered or unexported fields }
Server contains runtime state specific to the server-mode persona, e.g., HTTP router.
Notes:
- In the future, the HTTP routing could be factored into a separate module relying on the server (which would remain RPC-based). For now, it's simpler to keep the HTTP routing and backend implementation in one place.
func NewServer ¶
NewServer returns a new Server.
func (*Server) Loop ¶
Loop starts the server. This function does not return.
Source Files ¶
logging.go runtime.go server.go
- Version
- v0.1.0
- Published
- Jul 14, 2016
- Platform
- linux/amd64
- Imports
- 19 packages
- Last checked
- 9 minutes ago –
Tools for package owners.