QueryPoint returns all intervals containing the given timestamp.
(timestamp int64, fn func(ast.Interval) error)
| 115 | |
| 116 | // QueryPoint returns all intervals containing the given timestamp. |
| 117 | func (t *IntervalTree) QueryPoint(timestamp int64, fn func(ast.Interval) error) error { |
| 118 | return t.queryPoint(t.root, timestamp, fn) |
| 119 | } |
| 120 | |
| 121 | // queryPoint recursively queries for intervals containing a point. |
| 122 | func (t *IntervalTree) queryPoint(node *treeNode, timestamp int64, fn func(ast.Interval) error) error { |