0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00
zot/pkg/meta/version/common.go
LaurentiuNiculae af819e7b76
refactor(repodb): moving common utilities under pkg/meta (#1292)
* refactor(repodb): moving common utilities under pkg/meta

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>

* refactor(repodb): moved update, version components under pkg/meta

- updated wrapper initialization to recieve a log object in constructor

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>

* refactor(repodb): moved repodb initialization from controller to pkg/meta/repodb

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>

---------

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
2023-03-28 10:20:09 -07:00

31 lines
423 B
Go

package version
const (
Version1 = "V1"
Version2 = "V2"
Version3 = "V3"
CurrentVersion = Version1
)
const (
versionV1Index = iota
versionV2Index
versionV3Index
)
const DBVersionKey = "DBVersion"
func GetVersionIndex(dbVersion string) int {
index, ok := map[string]int{
Version1: versionV1Index,
Version2: versionV2Index,
Version3: versionV3Index,
}[dbVersion]
if !ok {
return -1
}
return index
}