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

Method HTTPClient

dgraphtest/local_cluster.go:1081–1098  ·  view source on GitHub ↗

HTTPClient creates an HTTP client

()

Source from the content-addressed store, hash-verified

1079
1080// HTTPClient creates an HTTP client
1081func (c *LocalCluster) HTTPClient() (*dgraphapi.HTTPClient, error) {
1082 alphaUrl, err := c.serverURL("alpha", "")
1083 if err != nil {
1084 return nil, err
1085 }
1086
1087 zeroUrl, err := c.serverURL("zero", "")
1088 if err != nil {
1089 return nil, err
1090 }
1091
1092 hc, err := dgraphapi.GetHttpClient(alphaUrl, zeroUrl)
1093 if err != nil {
1094 return nil, err
1095 }
1096 hc.AuthToken = c.conf.securityToken
1097 return hc, nil
1098}
1099
1100func (c *LocalCluster) GetAlphaHttpClient(alphaID int) (*dgraphapi.HTTPClient, error) {
1101 pubPort, err := publicPort(c.dcli, c.alphas[alphaID], alphaHttpPort)

Callers 15

TestCheckUpgradeFunction · 0.95
TestQueryDuplicateNodesFunction · 0.95
TestMainFunction · 0.95
TestBulkLoadVectorIndexFunction · 0.95
TestVectorDropAllFunction · 0.95
TestVectorSnapshotFunction · 0.95
TestVectorDropNamespaceFunction · 0.95

Calls 2

serverURLMethod · 0.95
GetHttpClientFunction · 0.92

Tested by 15

TestCheckUpgradeFunction · 0.76
TestQueryDuplicateNodesFunction · 0.76
TestMainFunction · 0.76
TestBulkLoadVectorIndexFunction · 0.76
TestVectorDropAllFunction · 0.76
TestVectorSnapshotFunction · 0.76
TestVectorDropNamespaceFunction · 0.76