parser

package
v0.7.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PR is an abbreviation for 'present'.
	PR CompareOperator = "pr"
	// EQ is an abbreviation for 'equals'.
	EQ CompareOperator = "eq"
	// NE is an abbreviation for 'not equals'.
	NE CompareOperator = "ne"
	// CO is an abbreviation for 'contains'.
	CO CompareOperator = "co"
	// IN is an abbreviation for 'in'.
	IN CompareOperator = "in"
	// SW is an abbreviation for 'starts with'.
	SW CompareOperator = "sw"
	// EW an abbreviation for 'ends with'.
	EW CompareOperator = "ew"
	// GT is an abbreviation for 'greater than'.
	GT CompareOperator = "gt"
	// LT is an abbreviation for 'less than'.
	LT CompareOperator = "lt"
	// GE is an abbreviation for 'greater or equal than'.
	GE CompareOperator = "ge"
	// LE is an abbreviation for 'less or equal than'.
	LE CompareOperator = "le"

	// IS allows comparison of Object/Resource Types - added for Cedar compat
	IS CompareOperator = "is"

	// AND is the logical operation and (&&).
	AND LogicalOperator = "and"
	// OR is the logical operation or (||).
	OR LogicalOperator = "or"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeExpression

type AttributeExpression struct {
	AttributePath string
	Operator      CompareOperator
	CompareValue  string
}

func (AttributeExpression) Dif added in v0.7.0

func (e AttributeExpression) Dif() string

func (AttributeExpression) String

func (e AttributeExpression) String() string

type CompareOperator

type CompareOperator string

type Expression

type Expression interface {
	String() string
	Dif() string
	// contains filtered or unexported methods
}

func ParseFilter

func ParseFilter(expression string) (Expression, error)

ParseFilter parses a SCIM-like (RFC7644) filter expression string and returns an AST as an Expression

type LogicalExpression

type LogicalExpression struct {
	Operator    LogicalOperator
	Left, Right Expression
}

func (LogicalExpression) Dif added in v0.7.0

func (e LogicalExpression) Dif() string

func (LogicalExpression) String

func (e LogicalExpression) String() string

type LogicalOperator

type LogicalOperator string

type NotExpression

type NotExpression struct {
	Expression Expression
}

func (NotExpression) Dif added in v0.7.0

func (e NotExpression) Dif() string

func (NotExpression) String

func (e NotExpression) String() string

type PrecedenceExpression

type PrecedenceExpression struct {
	Expression Expression
}

func (PrecedenceExpression) Dif added in v0.7.0

func (PrecedenceExpression) String

func (e PrecedenceExpression) String() string

type ValuePathExpression

type ValuePathExpression struct {
	Attribute   string
	VPathFilter Expression
}

func (ValuePathExpression) Dif added in v0.7.0

func (e ValuePathExpression) Dif() string

func (ValuePathExpression) String

func (e ValuePathExpression) String() string

Jump to

Keyboard shortcuts

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