mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 04:18:01 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
21 lines
445 B
Go
21 lines
445 B
Go
package repository
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/zitadel/zitadel/internal/errors"
|
|
)
|
|
|
|
var versionRegexp = regexp.MustCompile(`^v[0-9]+(\.[0-9]+){0,2}$`)
|
|
|
|
//Version represents the semver of an aggregate
|
|
type Version string
|
|
|
|
//Validate checks if the v is semver
|
|
func (v Version) Validate() error {
|
|
if !versionRegexp.MatchString(string(v)) {
|
|
return errors.ThrowPreconditionFailed(nil, "MODEL-luDuS", "version is not semver")
|
|
}
|
|
return nil
|
|
}
|