/
types_filter.go
59 lines (42 loc) · 1.24 KB
/
types_filter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package types
// FilterOperator is a filter operator.
type FilterOperator int
const (
// FilterAnd is the & operator.
FilterAnd FilterOperator = iota
// FilterOr is the | operator.
FilterOr
// FilterNot is the ! operator.
FilterNot
// FilterPresent is the =* operator.
FilterPresent
// FilterEqualityMatch is the = operator.
FilterEqualityMatch
// FilterSubstrings is the = operator in conjunction with a string that
// has leading and trailing * characters.
FilterSubstrings
// FilterSubstringsPrefix is the = operator in conjunction with a string
// that has a leading * character.
FilterSubstringsPrefix
// FilterSubstringsPostfix is the = operator in conjunction with a string
// that has a trailing * character.
FilterSubstringsPostfix
// FilterGreaterOrEqual is the >= operator.
FilterGreaterOrEqual
// FilterLessOrEqual is the <= operator.
FilterLessOrEqual
// FilterApproxMatch is the ~= operator.
FilterApproxMatch
)
// Filter is an LDAP-style filter string.
type Filter struct {
// Op is the operation.
Op FilterOperator
// Children is a list of any sub-filters if this filter is a compound
// filter.
Children []*Filter
// Left is the left operand.
Left string
// Right is the right operand.
Right string
}