package ptr

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

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

Index

Functions

func Ptr

func Ptr(data any, path storage.Path) (any, error)

func ValidateASTArrayIndex

func ValidateASTArrayIndex(arr *ast.Array, s string, path storage.Path) (int, error)

func ValidateArrayIndex

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

func ValidateArrayIndexForWrite

func ValidateArrayIndexForWrite(arr []any, 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.

func ValuePtr

func ValuePtr(data ast.Value, path storage.Path) (ast.Value, error)

Source Files

ptr.go

Version
v1.5.1 (latest)
Published
Jun 4, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
1 day ago

Tools for package owners.