query

package
v0.0.0-...-f1573f2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComparatorTypeStrings

func ComparatorTypeStrings() []string

ComparatorTypeStrings returns a slice of all String values of the enum

func Execute

func Execute(q NodeFilter, ao *engine.Objects) *engine.Objects

Types

type AndQuery

type AndQuery struct {
	Subitems []NodeFilter
}

func (AndQuery) Evaluate

func (q AndQuery) Evaluate(o *engine.Object) bool

func (AndQuery) ToLDAPFilter

func (q AndQuery) ToLDAPFilter() string

func (AndQuery) ToWhereClause

func (q AndQuery) ToWhereClause() string

type BinaryAndModifier

type BinaryAndModifier struct {
	Value int64
}

func (BinaryAndModifier) Evaluate

func (am BinaryAndModifier) Evaluate(a engine.Attribute, o *engine.Object) bool

func (BinaryAndModifier) ToLDAPFilter

func (am BinaryAndModifier) ToLDAPFilter(a string) string

func (BinaryAndModifier) ToWhereClause

func (am BinaryAndModifier) ToWhereClause(a string) string

type BinaryOrModifier

type BinaryOrModifier struct {
	Value int64
}

func (BinaryOrModifier) Evaluate

func (om BinaryOrModifier) Evaluate(a engine.Attribute, o *engine.Object) bool

func (BinaryOrModifier) ToLDAPFilter

func (om BinaryOrModifier) ToLDAPFilter(a string) string

func (BinaryOrModifier) ToWhereClause

func (om BinaryOrModifier) ToWhereClause(a string) string

type Comparator

type Comparator[t cmp.Ordered] ComparatorType

func (Comparator[t]) Compare

func (c Comparator[t]) Compare(a, b t) bool

func (Comparator[t]) String

func (c Comparator[t]) String() string

type ComparatorType

type ComparatorType byte
const (
	CompareInvalid ComparatorType = iota
	CompareEquals
	CompareLessThan
	CompareLessThanEqual
	CompareGreaterThan
	CompareGreaterThanEqual
)

func ComparatorTypeString

func ComparatorTypeString(s string) (ComparatorType, error)

ComparatorTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ComparatorTypeValues

func ComparatorTypeValues() []ComparatorType

ComparatorTypeValues returns all values of the enum

func (ComparatorType) IsAComparatorType

func (i ComparatorType) IsAComparatorType() bool

IsAComparatorType returns "true" if the value is listed in the enum definition. "false" otherwise

func (ComparatorType) String

func (i ComparatorType) String() string

type CountModifier

type CountModifier struct {
	Comparator ComparatorType
	Value      int
}

func (CountModifier) Evaluate

func (cm CountModifier) Evaluate(a engine.Attribute, o *engine.Object) bool

func (CountModifier) ToLDAPFilter

func (cm CountModifier) ToLDAPFilter(a string) string

func (CountModifier) ToWhereClause

func (cm CountModifier) ToWhereClause(a string) string

type EdgeQuery

type EdgeQuery struct {
	Direction engine.EdgeDirection
	Edge      engine.Edge
	Target    NodeFilter
}

func (EdgeQuery) Evaluate

func (p EdgeQuery) Evaluate(o *engine.Object) bool

func (EdgeQuery) ToLDAPFilter

func (p EdgeQuery) ToLDAPFilter() string

func (EdgeQuery) ToWhereClause

func (p EdgeQuery) ToWhereClause() string

type FilterAnyAttribute

type FilterAnyAttribute struct {
	Attribute FilterAttribute
}

Wraps any attribute around a queryattribute interface

func (FilterAnyAttribute) Evaluate

func (qaa FilterAnyAttribute) Evaluate(o *engine.Object) bool

func (FilterAnyAttribute) ToLDAPFilter

func (qaa FilterAnyAttribute) ToLDAPFilter() string

func (FilterAnyAttribute) ToWhereClause

func (qaa FilterAnyAttribute) ToWhereClause() string

type FilterAttribute

type FilterAttribute interface {
	Evaluate(a engine.Attribute, o *engine.Object) bool
	ToLDAPFilter(a string) string
	ToWhereClause(a string) string
}

type FilterMultipleAttributes

type FilterMultipleAttributes struct {
	AttributeGlobString string
	Attributes          []engine.Attribute
	FilterAttribute     FilterAttribute
}

Wraps one Attribute around a queryattribute interface

func (FilterMultipleAttributes) Evaluate

func (qma FilterMultipleAttributes) Evaluate(o *engine.Object) bool

func (FilterMultipleAttributes) ToLDAPFilter

func (qma FilterMultipleAttributes) ToLDAPFilter() string

func (FilterMultipleAttributes) ToWhereClause

func (qma FilterMultipleAttributes) ToWhereClause() string

type FilterObjectType

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

func (FilterObjectType) Evaluate

func (fot FilterObjectType) Evaluate(o *engine.Object) bool

func (FilterObjectType) ToLDAPFilter

func (fot FilterObjectType) ToLDAPFilter() string

func (FilterObjectType) ToWhereClause

func (fot FilterObjectType) ToWhereClause() string

type FilterOneAttribute

type FilterOneAttribute struct {
	Attribute       engine.Attribute
	FilterAttribute FilterAttribute
}

Wraps one Attribute around a queryattribute interface

func (FilterOneAttribute) Evaluate

func (qoa FilterOneAttribute) Evaluate(o *engine.Object) bool

func (FilterOneAttribute) ToLDAPFilter

func (qoa FilterOneAttribute) ToLDAPFilter() string

func (FilterOneAttribute) ToWhereClause

func (qoa FilterOneAttribute) ToWhereClause() string

type HasAttr

type HasAttr struct{}

func (HasAttr) Evaluate

func (ha HasAttr) Evaluate(a engine.Attribute, o *engine.Object) bool

func (HasAttr) ToLDAPFilter

func (ha HasAttr) ToLDAPFilter(a string) string

func (HasAttr) ToWhereClause

func (ha HasAttr) ToWhereClause(a string) string

type HasGlobMatch

type HasGlobMatch struct {
	Casesensitive bool
	Globstr       string
	Match         glob.Glob
}

func (HasGlobMatch) Evaluate

func (hgm HasGlobMatch) Evaluate(a engine.Attribute, o *engine.Object) bool

func (HasGlobMatch) ToLDAPFilter

func (hgm HasGlobMatch) ToLDAPFilter(a string) string

func (HasGlobMatch) ToWhereClause

func (hgm HasGlobMatch) ToWhereClause(a string) string

type HasRegexpMatch

type HasRegexpMatch struct {
	RegExp *regexp.Regexp
}

func (HasRegexpMatch) Evaluate

func (hrm HasRegexpMatch) Evaluate(a engine.Attribute, o *engine.Object) (result bool)

func (HasRegexpMatch) ToLDAPFilter

func (hrm HasRegexpMatch) ToLDAPFilter(a string) string

func (HasRegexpMatch) ToWhereClause

func (hrm HasRegexpMatch) ToWhereClause(a string) string

type HasStringMatch

type HasStringMatch struct {
	Casesensitive bool
	Value         string
}

func (HasStringMatch) Evaluate

func (hsm HasStringMatch) Evaluate(a engine.Attribute, o *engine.Object) bool

func (HasStringMatch) ToLDAPFilter

func (hsm HasStringMatch) ToLDAPFilter(a string) string

func (HasStringMatch) ToWhereClause

func (hsm HasStringMatch) ToWhereClause(a string) string

type IndexSelectorInfo

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

type LengthModifier

type LengthModifier struct {
	Comparator ComparatorType
	Value      int
}

func (LengthModifier) Evaluate

func (lm LengthModifier) Evaluate(a engine.Attribute, o *engine.Object) bool

func (LengthModifier) ToLDAPFilter

func (lm LengthModifier) ToLDAPFilter(a string) string

func (LengthModifier) ToWhereClause

func (lm LengthModifier) ToWhereClause(a string) string

type Limit

type Limit struct {
	Counter int64
}

func (*Limit) Evaluate

func (l *Limit) Evaluate(o *engine.Object) bool

func (*Limit) ToLDAPFilter

func (l *Limit) ToLDAPFilter() string

func (*Limit) ToWhereClause

func (l *Limit) ToWhereClause() string

type LowerStringAttribute

type LowerStringAttribute engine.Attribute

func (LowerStringAttribute) Strings

func (a LowerStringAttribute) Strings(o *engine.Object) []string

type NodeFilter

type NodeFilter interface {
	Evaluate(o *engine.Object) bool
	ToLDAPFilter() string
	ToWhereClause() string
}

func ParseLDAPQuery

func ParseLDAPQuery(s string, ao *engine.Objects) (string, NodeFilter, error)

func ParseLDAPQueryStrict

func ParseLDAPQueryStrict(s string, ao *engine.Objects) (NodeFilter, error)

type NotQuery

type NotQuery struct {
	Subitem NodeFilter
}

func (NotQuery) Evaluate

func (q NotQuery) Evaluate(o *engine.Object) bool

func (NotQuery) ToLDAPFilter

func (q NotQuery) ToLDAPFilter() string

func (NotQuery) ToWhereClause

func (q NotQuery) ToWhereClause() string

type OrQuery

type OrQuery struct {
	Subitems []NodeFilter
}

func (OrQuery) Evaluate

func (q OrQuery) Evaluate(o *engine.Object) bool

func (OrQuery) ToLDAPFilter

func (q OrQuery) ToLDAPFilter() string

func (OrQuery) ToWhereClause

func (q OrQuery) ToWhereClause() string

type Random100

type Random100 struct {
	Comparator ComparatorType
	Value      int64
}

func (Random100) Evaluate

func (r Random100) Evaluate(o *engine.Object) bool

func (Random100) ToLDAPFilter

func (r Random100) ToLDAPFilter() string

func (Random100) ToWhereClause

func (r Random100) ToWhereClause() string

type RecursiveDNmatcher

type RecursiveDNmatcher struct {
	DN string
	AO *engine.Objects
}

func (RecursiveDNmatcher) Evaluate

func (rdn RecursiveDNmatcher) Evaluate(a engine.Attribute, o *engine.Object) bool

func (RecursiveDNmatcher) ToLDAPFilter

func (rdn RecursiveDNmatcher) ToLDAPFilter(a string) string

func (RecursiveDNmatcher) ToWhereClause

func (rdn RecursiveDNmatcher) ToWhereClause(a string) string

type SinceModifier

type SinceModifier struct {
	Comparator ComparatorType
	TimeSpan   *timespan.Timespan
}

func (SinceModifier) Evaluate

func (sm SinceModifier) Evaluate(a engine.Attribute, o *engine.Object) bool

func (SinceModifier) ToLDAPFilter

func (sm SinceModifier) ToLDAPFilter(a string) string

func (SinceModifier) ToWhereClause

func (sm SinceModifier) ToWhereClause(a string) string

type TimediffModifier

type TimediffModifier struct {
	Attribute2 engine.Attribute
	Comparator ComparatorType
	TimeSpan   *timespan.Timespan
}

func (TimediffModifier) Evaluate

func (td TimediffModifier) Evaluate(a engine.Attribute, o *engine.Object) bool

func (TimediffModifier) ToLDAPFilter

func (td TimediffModifier) ToLDAPFilter(a string) string

func (TimediffModifier) ToWhereClause

func (td TimediffModifier) ToWhereClause(a string) string

type TypedComparison

type TypedComparison[t cmp.Ordered] struct {
	Comparator ComparatorType
	Value      t
}

func (TypedComparison[t]) Evaluate

func (tc TypedComparison[t]) Evaluate(a engine.Attribute, o *engine.Object) bool

func (TypedComparison[t]) ToLDAPFilter

func (tc TypedComparison[t]) ToLDAPFilter(a string) string

func (TypedComparison[t]) ToWhereClause

func (tc TypedComparison[t]) ToWhereClause(a string) string

Jump to

Keyboard shortcuts

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