2022-03-06 05:47:40 +00:00
|
|
|
package model
|
2022-03-03 11:20:43 +00:00
|
|
|
|
2022-06-28 03:15:50 +00:00
|
|
|
import (
|
|
|
|
"regexp"
|
|
|
|
)
|
|
|
|
|
2022-03-03 11:20:43 +00:00
|
|
|
const (
|
|
|
|
errFmtValueNil = "cannot value model type '%T' with value nil to driver.Value"
|
|
|
|
errFmtScanNil = "cannot scan model type '%T' from value nil: type doesn't support nil values"
|
|
|
|
errFmtScanInvalidType = "cannot scan model type '%T' from type '%T' with value '%v'"
|
|
|
|
errFmtScanInvalidTypeErr = "cannot scan model type '%T' from type '%T' with value '%v': %w"
|
|
|
|
)
|
2022-03-28 01:26:30 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
// SecondFactorMethodTOTP method using Time-Based One-Time Password applications like Google Authenticator.
|
|
|
|
SecondFactorMethodTOTP = "totp"
|
|
|
|
|
2023-04-10 07:01:23 +00:00
|
|
|
// SecondFactorMethodWebAuthn method using WebAuthn devices like YubiKey's.
|
|
|
|
SecondFactorMethodWebAuthn = "webauthn"
|
2022-03-28 01:26:30 +00:00
|
|
|
|
|
|
|
// SecondFactorMethodDuo method using Duo application to receive push notifications.
|
|
|
|
SecondFactorMethodDuo = "mobile_push"
|
|
|
|
)
|
2022-06-28 03:15:50 +00:00
|
|
|
|
2023-05-07 07:51:35 +00:00
|
|
|
var reSemanticVersion = regexp.MustCompile(`^v?(?P<Major>0|[1-9]\d*)\.(?P<Minor>0|[1-9]\d*)\.(?P<Patch>0|[1-9]\d*)(?:-(?P<PreRelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<Metadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`)
|
2022-06-28 03:15:50 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
semverRegexpGroupPreRelease = "PreRelease"
|
|
|
|
)
|