forked from TrueCloudLab/frostfs-node
69826ebd90
Create `version` package and implement `IsValid` function which checks if version is not earlier than the genesis one. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
17 lines
329 B
Go
17 lines
329 B
Go
package version
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-api-go/pkg"
|
|
)
|
|
|
|
// IsValid checks if Version is not earlier than the genesis version of the NeoFS.
|
|
func IsValid(v pkg.Version) bool {
|
|
const (
|
|
startMajor = 2
|
|
startMinor = 7
|
|
)
|
|
|
|
mjr := v.Major()
|
|
|
|
return mjr > startMajor || mjr == startMajor && v.Minor() >= startMinor
|
|
}
|