-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(promapi): move
MinTime
and MaxTime
- Loading branch information
Showing
3 changed files
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,21 @@ | ||
// Package promapi contains generated code for OpenAPI specification. | ||
package promapi | ||
|
||
import ( | ||
"math" | ||
"time" | ||
) | ||
|
||
// https://github.com/prometheus/prometheus/blob/e9b94515caa4c0d7a0e31f722a1534948ebad838/web/api/v1/api.go#L783-L794 | ||
var ( | ||
// MinTime is the default timestamp used for the begin of optional time ranges. | ||
// Exposed to let downstream projects to reference it. | ||
MinTime = time.Unix(math.MinInt64/1000+62135596801, 0).UTC() | ||
|
||
// MaxTime is the default timestamp used for the end of optional time ranges. | ||
// Exposed to let downstream projects to reference it. | ||
MaxTime = time.Unix(math.MaxInt64/1000-62135596801, 999999999).UTC() | ||
|
||
minTimeFormatted = MinTime.Format(time.RFC3339Nano) | ||
maxTimeFormatted = MaxTime.Format(time.RFC3339Nano) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters