MCPcopy
hub / github.com/dgraph-io/dgraph / DgraphClient

Function DgraphClient

testutil/client.go:336–344  ·  view source on GitHub ↗

DgraphClient creates a Dgraph client. It is intended to be called from TestMain() to establish a Dgraph connection shared by all tests, so there is no testing.T instance for it to use.

(serviceAddr string)

Source from the content-addressed store, hash-verified

334// It is intended to be called from TestMain() to establish a Dgraph connection shared
335// by all tests, so there is no testing.T instance for it to use.
336func DgraphClient(serviceAddr string) (*dgo.Dgraph, error) {
337 conn, err := grpc.NewClient(serviceAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
338 if err != nil {
339 return nil, err
340 }
341
342 dg := dgo.NewDgraphClient(api.NewDgraphClient(conn))
343 return dg, nil
344}
345
346// DgraphClientWithCerts creates a Dgraph client with TLS configured using the given
347// viper configuration.

Callers 15

cleanupMethod · 0.92
testCaseFunction · 0.92
testCaseWithAclFunction · 0.92
testDeleteEdgeWithStarFunction · 0.92
TestQueriesFunction · 0.92
Test1MillionFunction · 0.92
TestMainFunction · 0.92
BenchmarkQueriesFunction · 0.92
TestQueriesFor21MillionFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestQueriesFunction · 0.74
Test1MillionFunction · 0.74
TestMainFunction · 0.74
BenchmarkQueriesFunction · 0.74
TestQueriesFor21MillionFunction · 0.74
TestJaegerReceivesTracesFunction · 0.74
TestExportAndLoadJsonFunction · 0.74