MCPcopy Create free account
hub / github.com/brimdata/super / ClientURI

Method ClientURI

cli/dbflags/flags.go:105–114  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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.
105func (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
116func localServer() bool {
117 _, err := client.NewConnection().Ping(context.Background())

Callers 3

ConnectionMethod · 0.95
OpenMethod · 0.95
RunMethod · 0.80

Calls 3

URIMethod · 0.95
MustParseURIFunction · 0.92
localServerFunction · 0.85

Tested by

no test coverage detected