summaryrefslogtreecommitdiff
path: root/internal/utils/const.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/utils/const.go')
-rw-r--r--internal/utils/const.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/utils/const.go b/internal/utils/const.go
new file mode 100644
index 000000000..05ffb344c
--- /dev/null
+++ b/internal/utils/const.go
@@ -0,0 +1,17 @@
+package utils
+
+import (
+ "errors"
+ "regexp"
+ "time"
+)
+
+// ErrTimeoutReached error thrown when a timeout is reached
+var ErrTimeoutReached = errors.New("timeout reached")
+var parseDurationRegexp = regexp.MustCompile(`^(?P<Duration>[1-9]\d*?)(?P<Unit>[smhdwMy])?$`)
+
+const Hour = time.Minute * 60
+const Day = Hour * 24
+const Week = Day * 7
+const Year = Day * 365
+const Month = Year / 12