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)
| 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. |
| 336 | func 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. |
no outgoing calls