opatranslator

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LtOp    = "lt"
	LteOp   = "lte"
	GtOp    = "gt"
	GteOp   = "gte"
	EqOp    = "eq"
	EqualOp = "equal"
	NeqOp   = "neq"
	// https://github.com/open-policy-agent/opa/blob/main/ast/builtins.go#L345
	InOp = "internal.member_2"
)

Variables

View Source
var ErrEmptyQuery = errors.New("empty query")

Functions

func HandleEquals

func HandleEquals(pipeline *[]bson.M, fieldName string, fieldValue interface{})

Parse the == into equivalent mongo query.

func HandleGreaterThan

func HandleGreaterThan(pipeline *[]bson.M, fieldName string, fieldValue interface{})

Parse the > into equivalent mongo query.

func HandleGreaterThanEquals

func HandleGreaterThanEquals(pipeline *[]bson.M, fieldName string, fieldValue interface{})

Parse the >= into equivalent mongo query.

func HandleIn added in v1.7.0

func HandleIn(pipeline *[]bson.M, fieldName string, fieldValue interface{})

Parse the in operator into equivalent mongo query.

func HandleLessThan

func HandleLessThan(pipeline *[]bson.M, fieldName string, fieldValue interface{})

Parse the < into equivalent mongo query.

func HandleLessThanEquals

func HandleLessThanEquals(pipeline *[]bson.M, fieldName string, fieldValue interface{})

Parse the <= into equivalent mongo query.

func HandleNotEquals

func HandleNotEquals(pipeline *[]bson.M, fieldName string, fieldValue interface{})

Parse the != into equivalent mongo query.

func HandleOperations

func HandleOperations(operation string, pipeline *[]bson.M, fieldName string, fieldValue interface{}) bool

Types

type OPAClient

type OPAClient struct{}

func (*OPAClient) ProcessQuery

func (c *OPAClient) ProcessQuery(pq *rego.PartialQueries) (bson.M, error)

type Queries

type Queries struct {
	Pipeline bson.M
}

Jump to

Keyboard shortcuts

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