mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-07-03 16:40:49 +02:00
WIP: add tile updating in in web mapper with pg listen/notify
This commit is contained in:
@ -11,10 +11,16 @@ import (
|
||||
|
||||
type DBClientCreator func() (DBClient, error)
|
||||
|
||||
func IsPostgreSQL(host string) (string, bool) {
|
||||
if strings.HasPrefix(host, "postgres:") {
|
||||
return host[len("postgres:"):], true
|
||||
}
|
||||
return "", false
|
||||
}
|
||||
|
||||
func CreateDBClientCreator(host string, port int) DBClientCreator {
|
||||
|
||||
if strings.HasPrefix(host, "postgres:") {
|
||||
host = host[len("postgres:"):]
|
||||
if host, ok := IsPostgreSQL(host); ok {
|
||||
return func() (DBClient, error) {
|
||||
return NewPGClient(host)
|
||||
}
|
||||
|
Reference in New Issue
Block a user