GetEndTime extracts the end time from an interval. Returns MaxInt64 for unbounded end (positive infinity).
(interval ast.Interval)
| 365 | // GetEndTime extracts the end time from an interval. |
| 366 | // Returns MaxInt64 for unbounded end (positive infinity). |
| 367 | func GetEndTime(interval ast.Interval) int64 { |
| 368 | switch interval.End.Type { |
| 369 | case ast.TimestampBound: |
| 370 | return interval.End.Timestamp |
| 371 | case ast.PositiveInfinityBound: |
| 372 | return maxInt64 |
| 373 | case ast.NegativeInfinityBound: |
| 374 | return minInt64 |
| 375 | default: |
| 376 | return 0 |
| 377 | } |
| 378 | } |
| 379 | |
| 380 | // containsTimestamp checks if an interval contains a timestamp. |
| 381 | func containsTimestamp(interval ast.Interval, timestamp int64) bool { |
no outgoing calls
no test coverage detected