storage

package
v1.46.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReadsNotSupported = &Error{Code: readsNotSupportedErr}

ErrReadsNotSupported indicates the caller attempted to perform a read against a store at a location that does not support them.

Functions

func New

func New() storage.Store

New constructs a new store that can also act as a namespace for the evaluation VM.

func New2

func New2(ctx context.Context, logger logging.Logger, prom prometheus.Registerer, config []byte, id string) (storage.Store, error)

func NewFromObject

func NewFromObject(data interface{}) storage.Store

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

func WriteUnchecked

func WriteUnchecked(ctx context.Context, store storage.Store, op storage.PatchOp, path storage.Path, value interface{}) error

WriteUnchecked is a convenience function to invoke the write unchecked. It will create a new Transaction to perform the write with, and clean up after itself

func WriteUncheckedTxn

func WriteUncheckedTxn(ctx context.Context, store storage.Store, txn storage.Transaction, op storage.PatchOp, path storage.Path, value interface{}) error

Types

type BJSONReader

type BJSONReader interface {
	ReadBJSON(context.Context, storage.Transaction, storage.Path) (bjson.Json, error)
}

type DataPlugins

type DataPlugins interface {
	RegisterDataPlugin(name string, path storage.Path)
}

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

Error is the error type returned by the storage layer.

func (*Error) Error

func (err *Error) Error() string

func (*Error) Is

func (err *Error) Is(target error) bool

type Options

type Options struct {
	Stores []StoreOptions
}

type StoreOptions

type StoreOptions struct {
	Paths   [][2]storage.Path // List of (base path, complete path) the attached storage handles.
	New     func(ctx context.Context, logger logging.Logger, prom prometheus.Registerer, opts interface{}) (storage.Store, error)
	Options interface{}
}

StoreOptions stores the configuration options for the attached store.

type WriterUnchecked

type WriterUnchecked interface {
	WriteUnchecked(context.Context, storage.Transaction, storage.PatchOp, storage.Path, interface{}) error
}

Directories

Path Synopsis
Package errors contains reusable error-related code for the storage layer.
Package errors contains reusable error-related code for the storage layer.
Package inmem implements an in-memory version of the policy engine's storage layer.
Package inmem implements an in-memory version of the policy engine's storage layer.
Package merge contains helpers to merge data structures frequently encountered in OPA.
Package merge contains helpers to merge data structures frequently encountered in OPA.
Package ptr provides utilities for pointer operations using storage layer paths.
Package ptr provides utilities for pointer operations using storage layer paths.
see marker below
see marker below

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL