(dbHost string)
| 91 | } |
| 92 | |
| 93 | func parsePgSQLHostPort(dbHost string) (host string, port string) { |
| 94 | if strings.Contains(dbHost, ":") { |
| 95 | idx := strings.LastIndex(dbHost, ":") |
| 96 | host, port = dbHost[:idx], dbHost[idx+1:] |
| 97 | } else if len(dbHost) > 0 { |
| 98 | host = dbHost |
| 99 | } |
| 100 | if host == "" { |
| 101 | host = "127.0.0.1" |
| 102 | } |
| 103 | if port == "" { |
| 104 | port = "5432" |
| 105 | } |
| 106 | return host, port |
| 107 | } |
| 108 | |
| 109 | // CheckDatabaseResp check database response |
| 110 | type CheckDatabaseResp struct { |