authelia/internal/utils/const.go
Amir Zarrinkafsh be0cc72473
[CI] Add goconst linter (#961)
* [CI] Add goconst linter

* Implement goconst recommendations

* Rename defaultPolicy to denyPolicy

* Change order for test constants

Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-05-02 18:20:40 +02:00

29 lines
714 B
Go

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])?$`)
// Hour is an int based representation of the time unit.
const Hour = time.Minute * 60
// Day is an int based representation of the time unit.
const Day = Hour * 24
// Week is an int based representation of the time unit.
const Week = Day * 7
// Year is an int based representation of the time unit.
const Year = Day * 365
// Month is an int based representation of the time unit.
const Month = Year / 12
const testStringInput = "abcdefghijkl"