ClientURI returns the URI of the database to connect to. If the database path is the defaultDataDir, it first checks if a SuperDB service is running on localhost:9867 and if so uses http://localhost:9867 as the database location.
()
| 103 | // the defaultDataDir, it first checks if a SuperDB service is running on |
| 104 | // localhost:9867 and if so uses http://localhost:9867 as the database location. |
| 105 | func (l *Flags) ClientURI() (*storage.URI, error) { |
| 106 | u, err := l.URI() |
| 107 | if err != nil { |
| 108 | return nil, err |
| 109 | } |
| 110 | if !l.dbSpecified && localServer() { |
| 111 | u = storage.MustParseURI("http://localhost:9867") |
| 112 | } |
| 113 | return u, nil |
| 114 | } |
| 115 | |
| 116 | func localServer() bool { |
| 117 | _, err := client.NewConnection().Ping(context.Background()) |
no test coverage detected