mirror of
https://github.com/project-zot/zot.git
synced 2024-12-16 21:56:37 -05:00
af819e7b76
* 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>
31 lines
423 B
Go
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
|
|
}
|