package inmem

import "github.com/open-policy-agent/opa/storage/inmem"

Package inmem implements an in-memory version of the policy engine's storage layer.

The in-memory store is used as the default storage layer implementation. The in-memory store supports multi-reader/single-writer concurrency with rollback.

Callers should assume the in-memory store does not make copies of written data. Once data is written to the in-memory store, it should not be modified (outside of calling Store.Write). Furthermore, data read from the in-memory store should be treated as read-only.

Index

Functions

func New

func New() storage.Store

New returns an empty in-memory store.

func NewFromObject

func NewFromObject(data map[string]interface{}) storage.Store

NewFromObject returns a new in-memory store from the supplied data object.

func NewFromReader

func NewFromReader(r io.Reader) storage.Store

NewFromReader returns a new in-memory store from a reader that produces a JSON serialized object. This function is for test purposes.

Source Files

index.go inmem.go txn.go

Version
v0.7.1
Published
Feb 25, 2018
Platform
js/wasm
Imports
13 packages
Last checked
4 seconds ago

Tools for package owners.