1 package ldmodel 2 3 // List of available operators 4 const ( 5 // OperatorIn matches a user value and clause value if the two values are equal (including their type). 6 OperatorIn Operator = "in" 7 // OperatorEndsWith matches a user value and clause value if they are both strings and the former ends with 8 // the latter. 9 OperatorEndsWith Operator = "endsWith" 10 // OperatorStartsWith matches a user value and clause value if they are both strings and the former starts 11 // with the latter. 12 OperatorStartsWith Operator = "startsWith" 13 // OperatorMatches matches a user value and clause value if they are both strings and the latter is a valid 14 // regular expression that matches the former. 15 OperatorMatches Operator = "matches" 16 // OperatorContains matches a user value and clause value if they are both strings and the former contains 17 // the latter. 18 OperatorContains Operator = "contains" 19 // OperatorLessThan matches a user value and clause value if they are both numbers and the former < the 20 // latter. 21 OperatorLessThan Operator = "lessThan" 22 // OperatorLessThanOrEqual matches a user value and clause value if they are both numbers and the former 23 // <= the latter. 24 OperatorLessThanOrEqual Operator = "lessThanOrEqual" 25 // OperatorGreaterThan matches a user value and clause value if they are both numbers and the former > the 26 // latter. 27 OperatorGreaterThan Operator = "greaterThan" 28 // OperatorGreaterThanOrEqual matches a user value and clause value if they are both numbers and the former 29 // >= the latter. 30 OperatorGreaterThanOrEqual Operator = "greaterThanOrEqual" 31 // OperatorBefore matches a user value and clause value if they are both timestamps and the former < the 32 // latter. 33 // 34 // A valid timestamp is either a string in RFC3339/ISO8601 format, or a number which is treated as Unix 35 // milliseconds. 36 OperatorBefore Operator = "before" 37 // OperatorAfter matches a user value and clause value if they are both timestamps and the former > the 38 // latter. 39 // 40 // A valid timestamp is either a string in RFC3339/ISO8601 format, or a number which is treated as Unix 41 // milliseconds. 42 OperatorAfter Operator = "after" 43 // OperatorSegmentMatch matches a user if the user is included in the user segment whose key is the clause 44 // value. 45 OperatorSegmentMatch Operator = "segmentMatch" 46 // OperatorSemVerEqual matches a user value and clause value if they are both semantic versions and they 47 // are equal. 48 // 49 // A semantic version is a string that either follows the Semantic Versions 2.0 spec, or is an abbreviated 50 // version consisting of digits and optional periods in the form "m" (equivalent to m.0.0) or "m.n" 51 // (equivalent to m.n.0). 52 OperatorSemVerEqual Operator = "semVerEqual" 53 // OperatorSemVerLessThan matches a user value and clause value if they are both semantic versions and the 54 // former < the latter. 55 // 56 // A semantic version is a string that either follows the Semantic Versions 2.0 spec, or is an abbreviated 57 // version consisting of digits and optional periods in the form "m" (equivalent to m.0.0) or "m.n" 58 // (equivalent to m.n.0). 59 OperatorSemVerLessThan Operator = "semVerLessThan" 60 // OperatorSemVerGreaterThan matches a user value and clause value if they are both semantic versions and 61 // the former > the latter. 62 // 63 // A semantic version is a string that either follows the Semantic Versions 2.0 spec, or is an abbreviated 64 // version consisting of digits and optional periods in the form "m" (equivalent to m.0.0) or "m.n" 65 // (equivalent to m.n.0). 66 OperatorSemVerGreaterThan Operator = "semVerGreaterThan" 67 ) 68 69 // Operator describes an operator for a clause. 70 type Operator string 71