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 ¶
- func New() storage.Store
- func NewFromObject(data map[string]interface{}) storage.Store
- func NewFromReader(r io.Reader) storage.Store
Functions ¶
func New ¶
New returns an empty in-memory store.
func NewFromObject ¶
NewFromObject returns a new in-memory store from the supplied data object.
func NewFromReader ¶
NewFromReader returns a new in-memory store from a reader that produces a JSON serialized object. This function is for test purposes.
Source Files ¶
- Version
- v0.5.6
- Published
- Aug 29, 2017
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 1 hour ago –
Tools for package owners.