nurse/config/schemes.go

21 lines
474 B
Go
Raw Permalink Normal View History

2022-04-28 16:35:02 +00:00
package config
import "strings"
var scheme2ServerType = map[string]ServerType{
"redis": ServerTypeRedis,
"psql": ServerTypePostgres,
"pgsql": ServerTypePostgres,
"postgres": ServerTypePostgres,
"pgx": ServerTypePostgres,
"mysql": ServerTypeMysql,
"mariadb": ServerTypeMysql,
2022-04-28 16:35:02 +00:00
}
func SchemeToServerType(scheme string) ServerType {
if match, ok := scheme2ServerType[strings.ToLower(scheme)]; ok {
return match
}
return ServerTypeUnspecified
}