| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package overloads |
| 18 |
|
| 19 |
|
| 20 |
const ( |
| 21 |
Conditional = "conditional" |
| 22 |
LogicalAnd = "logical_and" |
| 23 |
LogicalOr = "logical_or" |
| 24 |
LogicalNot = "logical_not" |
| 25 |
NotStrictlyFalse = "not_strictly_false" |
| 26 |
Equals = "equals" |
| 27 |
NotEquals = "not_equals" |
| 28 |
LessBool = "less_bool" |
| 29 |
LessInt64 = "less_int64" |
| 30 |
LessInt64Double = "less_int64_double" |
| 31 |
LessInt64Uint64 = "less_int64_uint64" |
| 32 |
LessUint64 = "less_uint64" |
| 33 |
LessUint64Double = "less_uint64_double" |
| 34 |
LessUint64Int64 = "less_uint64_int64" |
| 35 |
LessDouble = "less_double" |
| 36 |
LessDoubleInt64 = "less_double_int64" |
| 37 |
LessDoubleUint64 = "less_double_uint64" |
| 38 |
LessString = "less_string" |
| 39 |
LessBytes = "less_bytes" |
| 40 |
LessTimestamp = "less_timestamp" |
| 41 |
LessDuration = "less_duration" |
| 42 |
LessEqualsBool = "less_equals_bool" |
| 43 |
LessEqualsInt64 = "less_equals_int64" |
| 44 |
LessEqualsInt64Double = "less_equals_int64_double" |
| 45 |
LessEqualsInt64Uint64 = "less_equals_int64_uint64" |
| 46 |
LessEqualsUint64 = "less_equals_uint64" |
| 47 |
LessEqualsUint64Double = "less_equals_uint64_double" |
| 48 |
LessEqualsUint64Int64 = "less_equals_uint64_int64" |
| 49 |
LessEqualsDouble = "less_equals_double" |
| 50 |
LessEqualsDoubleInt64 = "less_equals_double_int64" |
| 51 |
LessEqualsDoubleUint64 = "less_equals_double_uint64" |
| 52 |
LessEqualsString = "less_equals_string" |
| 53 |
LessEqualsBytes = "less_equals_bytes" |
| 54 |
LessEqualsTimestamp = "less_equals_timestamp" |
| 55 |
LessEqualsDuration = "less_equals_duration" |
| 56 |
GreaterBool = "greater_bool" |
| 57 |
GreaterInt64 = "greater_int64" |
| 58 |
GreaterInt64Double = "greater_int64_double" |
| 59 |
GreaterInt64Uint64 = "greater_int64_uint64" |
| 60 |
GreaterUint64 = "greater_uint64" |
| 61 |
GreaterUint64Double = "greater_uint64_double" |
| 62 |
GreaterUint64Int64 = "greater_uint64_int64" |
| 63 |
GreaterDouble = "greater_double" |
| 64 |
GreaterDoubleInt64 = "greater_double_int64" |
| 65 |
GreaterDoubleUint64 = "greater_double_uint64" |
| 66 |
GreaterString = "greater_string" |
| 67 |
GreaterBytes = "greater_bytes" |
| 68 |
GreaterTimestamp = "greater_timestamp" |
| 69 |
GreaterDuration = "greater_duration" |
| 70 |
GreaterEqualsBool = "greater_equals_bool" |
| 71 |
GreaterEqualsInt64 = "greater_equals_int64" |
| 72 |
GreaterEqualsInt64Double = "greater_equals_int64_double" |
| 73 |
GreaterEqualsInt64Uint64 = "greater_equals_int64_uint64" |
| 74 |
GreaterEqualsUint64 = "greater_equals_uint64" |
| 75 |
GreaterEqualsUint64Double = "greater_equals_uint64_double" |
| 76 |
GreaterEqualsUint64Int64 = "greater_equals_uint64_int64" |
| 77 |
GreaterEqualsDouble = "greater_equals_double" |
| 78 |
GreaterEqualsDoubleInt64 = "greater_equals_double_int64" |
| 79 |
GreaterEqualsDoubleUint64 = "greater_equals_double_uint64" |
| 80 |
GreaterEqualsString = "greater_equals_string" |
| 81 |
GreaterEqualsBytes = "greater_equals_bytes" |
| 82 |
GreaterEqualsTimestamp = "greater_equals_timestamp" |
| 83 |
GreaterEqualsDuration = "greater_equals_duration" |
| 84 |
) |
| 85 |
|
| 86 |
|
| 87 |
const ( |
| 88 |
AddInt64 = "add_int64" |
| 89 |
AddUint64 = "add_uint64" |
| 90 |
AddDouble = "add_double" |
| 91 |
AddString = "add_string" |
| 92 |
AddBytes = "add_bytes" |
| 93 |
AddList = "add_list" |
| 94 |
AddTimestampDuration = "add_timestamp_duration" |
| 95 |
AddDurationTimestamp = "add_duration_timestamp" |
| 96 |
AddDurationDuration = "add_duration_duration" |
| 97 |
SubtractInt64 = "subtract_int64" |
| 98 |
SubtractUint64 = "subtract_uint64" |
| 99 |
SubtractDouble = "subtract_double" |
| 100 |
SubtractTimestampTimestamp = "subtract_timestamp_timestamp" |
| 101 |
SubtractTimestampDuration = "subtract_timestamp_duration" |
| 102 |
SubtractDurationDuration = "subtract_duration_duration" |
| 103 |
MultiplyInt64 = "multiply_int64" |
| 104 |
MultiplyUint64 = "multiply_uint64" |
| 105 |
MultiplyDouble = "multiply_double" |
| 106 |
DivideInt64 = "divide_int64" |
| 107 |
DivideUint64 = "divide_uint64" |
| 108 |
DivideDouble = "divide_double" |
| 109 |
ModuloInt64 = "modulo_int64" |
| 110 |
ModuloUint64 = "modulo_uint64" |
| 111 |
NegateInt64 = "negate_int64" |
| 112 |
NegateDouble = "negate_double" |
| 113 |
) |
| 114 |
|
| 115 |
|
| 116 |
const ( |
| 117 |
IndexList = "index_list" |
| 118 |
IndexMap = "index_map" |
| 119 |
IndexMessage = "index_message" |
| 120 |
) |
| 121 |
|
| 122 |
|
| 123 |
const ( |
| 124 |
DeprecatedIn = "in" |
| 125 |
InList = "in_list" |
| 126 |
InMap = "in_map" |
| 127 |
InMessage = "in_message" |
| 128 |
) |
| 129 |
|
| 130 |
|
| 131 |
const ( |
| 132 |
Size = "size" |
| 133 |
SizeString = "size_string" |
| 134 |
SizeBytes = "size_bytes" |
| 135 |
SizeList = "size_list" |
| 136 |
SizeMap = "size_map" |
| 137 |
SizeStringInst = "string_size" |
| 138 |
SizeBytesInst = "bytes_size" |
| 139 |
SizeListInst = "list_size" |
| 140 |
SizeMapInst = "map_size" |
| 141 |
) |
| 142 |
|
| 143 |
|
| 144 |
const ( |
| 145 |
Contains = "contains" |
| 146 |
EndsWith = "endsWith" |
| 147 |
Matches = "matches" |
| 148 |
StartsWith = "startsWith" |
| 149 |
) |
| 150 |
|
| 151 |
|
| 152 |
const ( |
| 153 |
ExtQuoteString = "strings_quote" |
| 154 |
) |
| 155 |
|
| 156 |
|
| 157 |
const ( |
| 158 |
ContainsString = "contains_string" |
| 159 |
EndsWithString = "ends_with_string" |
| 160 |
MatchesString = "matches_string" |
| 161 |
StartsWithString = "starts_with_string" |
| 162 |
) |
| 163 |
|
| 164 |
|
| 165 |
const ( |
| 166 |
ExtFormatString = "string_format" |
| 167 |
) |
| 168 |
|
| 169 |
|
| 170 |
const ( |
| 171 |
TimeGetFullYear = "getFullYear" |
| 172 |
TimeGetMonth = "getMonth" |
| 173 |
TimeGetDayOfYear = "getDayOfYear" |
| 174 |
TimeGetDate = "getDate" |
| 175 |
TimeGetDayOfMonth = "getDayOfMonth" |
| 176 |
TimeGetDayOfWeek = "getDayOfWeek" |
| 177 |
TimeGetHours = "getHours" |
| 178 |
TimeGetMinutes = "getMinutes" |
| 179 |
TimeGetSeconds = "getSeconds" |
| 180 |
TimeGetMilliseconds = "getMilliseconds" |
| 181 |
) |
| 182 |
|
| 183 |
|
| 184 |
const ( |
| 185 |
TimestampToYear = "timestamp_to_year" |
| 186 |
TimestampToMonth = "timestamp_to_month" |
| 187 |
TimestampToDayOfYear = "timestamp_to_day_of_year" |
| 188 |
TimestampToDayOfMonthZeroBased = "timestamp_to_day_of_month" |
| 189 |
TimestampToDayOfMonthOneBased = "timestamp_to_day_of_month_1_based" |
| 190 |
TimestampToDayOfWeek = "timestamp_to_day_of_week" |
| 191 |
TimestampToHours = "timestamp_to_hours" |
| 192 |
TimestampToMinutes = "timestamp_to_minutes" |
| 193 |
TimestampToSeconds = "timestamp_to_seconds" |
| 194 |
TimestampToMilliseconds = "timestamp_to_milliseconds" |
| 195 |
) |
| 196 |
|
| 197 |
|
| 198 |
const ( |
| 199 |
TimestampToYearWithTz = "timestamp_to_year_with_tz" |
| 200 |
TimestampToMonthWithTz = "timestamp_to_month_with_tz" |
| 201 |
TimestampToDayOfYearWithTz = "timestamp_to_day_of_year_with_tz" |
| 202 |
TimestampToDayOfMonthZeroBasedWithTz = "timestamp_to_day_of_month_with_tz" |
| 203 |
TimestampToDayOfMonthOneBasedWithTz = "timestamp_to_day_of_month_1_based_with_tz" |
| 204 |
TimestampToDayOfWeekWithTz = "timestamp_to_day_of_week_with_tz" |
| 205 |
TimestampToHoursWithTz = "timestamp_to_hours_with_tz" |
| 206 |
TimestampToMinutesWithTz = "timestamp_to_minutes_with_tz" |
| 207 |
TimestampToSecondsWithTz = "timestamp_to_seconds_tz" |
| 208 |
TimestampToMillisecondsWithTz = "timestamp_to_milliseconds_with_tz" |
| 209 |
) |
| 210 |
|
| 211 |
|
| 212 |
const ( |
| 213 |
DurationToHours = "duration_to_hours" |
| 214 |
DurationToMinutes = "duration_to_minutes" |
| 215 |
DurationToSeconds = "duration_to_seconds" |
| 216 |
DurationToMilliseconds = "duration_to_milliseconds" |
| 217 |
) |
| 218 |
|
| 219 |
|
| 220 |
const ( |
| 221 |
TypeConvertInt = "int" |
| 222 |
TypeConvertUint = "uint" |
| 223 |
TypeConvertDouble = "double" |
| 224 |
TypeConvertBool = "bool" |
| 225 |
TypeConvertString = "string" |
| 226 |
TypeConvertBytes = "bytes" |
| 227 |
TypeConvertTimestamp = "timestamp" |
| 228 |
TypeConvertDuration = "duration" |
| 229 |
TypeConvertType = "type" |
| 230 |
TypeConvertDyn = "dyn" |
| 231 |
) |
| 232 |
|
| 233 |
|
| 234 |
const ( |
| 235 |
IntToInt = "int64_to_int64" |
| 236 |
UintToInt = "uint64_to_int64" |
| 237 |
DoubleToInt = "double_to_int64" |
| 238 |
StringToInt = "string_to_int64" |
| 239 |
TimestampToInt = "timestamp_to_int64" |
| 240 |
DurationToInt = "duration_to_int64" |
| 241 |
) |
| 242 |
|
| 243 |
|
| 244 |
const ( |
| 245 |
UintToUint = "uint64_to_uint64" |
| 246 |
IntToUint = "int64_to_uint64" |
| 247 |
DoubleToUint = "double_to_uint64" |
| 248 |
StringToUint = "string_to_uint64" |
| 249 |
) |
| 250 |
|
| 251 |
|
| 252 |
const ( |
| 253 |
DoubleToDouble = "double_to_double" |
| 254 |
IntToDouble = "int64_to_double" |
| 255 |
UintToDouble = "uint64_to_double" |
| 256 |
StringToDouble = "string_to_double" |
| 257 |
) |
| 258 |
|
| 259 |
|
| 260 |
const ( |
| 261 |
BoolToBool = "bool_to_bool" |
| 262 |
StringToBool = "string_to_bool" |
| 263 |
) |
| 264 |
|
| 265 |
|
| 266 |
const ( |
| 267 |
BytesToBytes = "bytes_to_bytes" |
| 268 |
StringToBytes = "string_to_bytes" |
| 269 |
) |
| 270 |
|
| 271 |
|
| 272 |
const ( |
| 273 |
StringToString = "string_to_string" |
| 274 |
BoolToString = "bool_to_string" |
| 275 |
IntToString = "int64_to_string" |
| 276 |
UintToString = "uint64_to_string" |
| 277 |
DoubleToString = "double_to_string" |
| 278 |
BytesToString = "bytes_to_string" |
| 279 |
TimestampToString = "timestamp_to_string" |
| 280 |
DurationToString = "duration_to_string" |
| 281 |
) |
| 282 |
|
| 283 |
|
| 284 |
const ( |
| 285 |
TimestampToTimestamp = "timestamp_to_timestamp" |
| 286 |
StringToTimestamp = "string_to_timestamp" |
| 287 |
IntToTimestamp = "int64_to_timestamp" |
| 288 |
) |
| 289 |
|
| 290 |
|
| 291 |
const ( |
| 292 |
DurationToDuration = "duration_to_duration" |
| 293 |
StringToDuration = "string_to_duration" |
| 294 |
IntToDuration = "int64_to_duration" |
| 295 |
) |
| 296 |
|
| 297 |
|
| 298 |
const ( |
| 299 |
ToDyn = "to_dyn" |
| 300 |
) |
| 301 |
|
| 302 |
|
| 303 |
const ( |
| 304 |
Iterator = "@iterator" |
| 305 |
HasNext = "@hasNext" |
| 306 |
Next = "@next" |
| 307 |
) |
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
func IsTypeConversionFunction(function string) bool { |
| 312 |
switch function { |
| 313 |
case TypeConvertBool, |
| 314 |
TypeConvertBytes, |
| 315 |
TypeConvertDouble, |
| 316 |
TypeConvertDuration, |
| 317 |
TypeConvertDyn, |
| 318 |
TypeConvertInt, |
| 319 |
TypeConvertString, |
| 320 |
TypeConvertTimestamp, |
| 321 |
TypeConvertType, |
| 322 |
TypeConvertUint: |
| 323 |
return true |
| 324 |
default: |
| 325 |
return false |
| 326 |
} |
| 327 |
} |