ecb960f506
Change-Id: I2dc8d1d371139aa8bc805e92a2b80b71f580fd64
38 lines
659 B
Go
38 lines
659 B
Go
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package dbutil
|
|
|
|
// Implementation type of valid DBs
|
|
type Implementation int
|
|
|
|
const (
|
|
// Unknown is an unknown db type
|
|
Unknown Implementation = iota
|
|
// Postgres is a Postgresdb type
|
|
Postgres
|
|
// Cockroach is a Cockroachdb type
|
|
Cockroach
|
|
// Bolt is a Bolt kv store
|
|
Bolt
|
|
// Redis is a Redis kv store
|
|
Redis
|
|
)
|
|
|
|
func setImplementation(s string) Implementation {
|
|
switch s {
|
|
case "postgres":
|
|
return Postgres
|
|
case "cockroach":
|
|
return Cockroach
|
|
case "bolt":
|
|
return Bolt
|
|
case "redis":
|
|
return Redis
|
|
case "postgresql":
|
|
return Postgres
|
|
default:
|
|
return Unknown
|
|
}
|
|
}
|