package ptr

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

Package ptr provides utilities for pointer operations using storage layer paths.

Index

Functions

func Ptr

func Ptr(data interface{}, path storage.Path) (interface{}, error)

func ValidateArrayIndex

func ValidateArrayIndex(arr []interface{}, s string, path storage.Path) (int, error)

func ValidateArrayIndexForWrite

func ValidateArrayIndexForWrite(arr []interface{}, s string, i int, path storage.Path) (int, error)

ValidateArrayIndexForWrite also checks that `s` is a valid way to address an array element like `ValidateArrayIndex`, but returns a `resource_conflict` error if it is not.

Source Files

ptr.go

Version
v0.43.1
Published
Sep 7, 2022
Platform
js/wasm
Imports
3 packages
Last checked
40 minutes ago

Tools for package owners.