Helper functions for interval time extraction GetStartTime extracts the start time from an interval. Returns MinInt64 for unbounded start (negative infinity).
(interval ast.Interval)
| 350 | // GetStartTime extracts the start time from an interval. |
| 351 | // Returns MinInt64 for unbounded start (negative infinity). |
| 352 | func GetStartTime(interval ast.Interval) int64 { |
| 353 | switch interval.Start.Type { |
| 354 | case ast.TimestampBound: |
| 355 | return interval.Start.Timestamp |
| 356 | case ast.NegativeInfinityBound: |
| 357 | return minInt64 |
| 358 | case ast.PositiveInfinityBound: |
| 359 | return maxInt64 |
| 360 | default: |
| 361 | return 0 |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | // GetEndTime extracts the end time from an interval. |
| 366 | // Returns MaxInt64 for unbounded end (positive infinity). |
no outgoing calls
no test coverage detected