query

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type And

type And struct {
	Conditions []Evaluator // An array of the conditions within the AND structure.
}

And conditions perform a binary AND operation on other conditions. In order for an AND condition to evaluate as true all conditions within it should evaluate as true also.

func ParseAnd

func ParseAnd(expression string, offset int) (*And, int, error)

ParseAnd takes an expression and attempts to parse it into an And condition.

func (*And) Evaluate

func (a *And) Evaluate(entry *ldap.Entry) bool

Evaluate evaluates the query against the specified ldap entry.

func (*And) ToString

func (a *And) ToString() string

ToString produces a string version of this query condition

type Equals

type Equals struct {
	Attribute string
	Value     string
	Evaluator
}

func ParseEquals

func ParseEquals(expression string, offset int) (*Equals, int, error)

func (*Equals) Evaluate

func (e *Equals) Evaluate(entry *ldap.Entry) bool

func (*Equals) ToString

func (e *Equals) ToString() string

ToString produces a string version of this query condition

type Evaluator

type Evaluator interface {
	Evaluate(entry *ldap.Entry) bool // Evaluate evaluates the query against the specified ldap entry.
	ToString() string                // ToString produces a string version of this query condition
}

func Parse

func Parse(expression string, offset int) (Evaluator, int, error)

Parse takes an expression and an offset within that expression and turns it into an Evaluator chain. This can then be used to evaluate a query against a set of ldap entries.

type Not

type Not struct {
	Parent Evaluator
	Evaluator
}

func ParseNot

func ParseNot(expression string, offset int) (*Not, int, error)

func (*Not) Evaluate

func (n *Not) Evaluate(entry *ldap.Entry) bool

Evaluate evaluates the query against the specified ldap entry.

func (*Not) ToString

func (n *Not) ToString() string

ToString produces a string version of this query condition

type Or

type Or struct {
	Conditions []Evaluator
}

func ParseOr

func ParseOr(expression string, offset int) (*Or, int, error)

ParseOr takes an expression and attempts to parse it into an Or condition.

func (*Or) Evaluate

func (o *Or) Evaluate(entry *ldap.Entry) bool

func (*Or) ToString

func (o *Or) ToString() string

ToString produces a string version of this query condition

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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