Use a more general db client factory approach.

This commit is contained in:
Sascha L. Teichmann
2022-03-01 14:47:14 +01:00
parent 834c8a9bc6
commit c507663826
9 changed files with 99 additions and 53 deletions

View File

@ -83,7 +83,12 @@ func main() {
colors.TransparentDim = common.Clamp32f(
float32(transparentDim/100.0), 0.0, 100.0)
client, err := common.CreateDBClientCreator(host, port)()
cf, err := common.CreateDBClientFactory(host, port)
if err != nil {
log.Fatalf("error: %v\n", err)
}
client, err := cf.Create()
if err != nil {
log.Fatalf("Cannot connect to '%s:%d': %s", host, port, err)
}