celutils

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package celutils provides utilities for working with CEL expressions.

Index

Constants

View Source
const (
	// CELVariableClaims is the name of the claims variable in CEL expressions.
	CELVariableClaims = "claims"

	// CELVariableSubSHA256 is the name of the subSHA256 variable in CEL expressions.
	CELVariableSubSHA256 = "subSHA256"
)

Variables

This section is empty.

Functions

func Eval

func Eval(ast *cel.Ast, inputEnv map[string]any) (ref.Val, error)

Eval evaluates the given AST against the provided input environment.

func ParseCEL

func ParseCEL(input string) (*cel.Ast, error)

ParseCEL parses a CEL expression.

Types

type ErrorCELEval

type ErrorCELEval struct {
	// contains filtered or unexported fields
}

ErrorCELEval represents an error during CEL evaluation.

func (ErrorCELEval) Error

func (ErrorCELEval) Error() string

func (*ErrorCELEval) Is

func (e *ErrorCELEval) Is(target error) bool

Is returns true if target is a *ErrorCELEval.

func (*ErrorCELEval) Unwrap

func (e *ErrorCELEval) Unwrap() error

Unwrap returns the inner error from CEL evaluation.

type ErrorCELParse

type ErrorCELParse struct {
	// contains filtered or unexported fields
}

ErrorCELParse represents an error during CEL parsing.

func (ErrorCELParse) Error

func (ErrorCELParse) Error() string

func (*ErrorCELParse) Is

func (e *ErrorCELParse) Is(target error) bool

Is returns true if target is a *ErrorCELParse.

func (*ErrorCELParse) Unwrap

func (e *ErrorCELParse) Unwrap() error

Unwrap returns the inner error from CEL parsing.

Jump to

Keyboard shortcuts

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