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

Method GetZeroStateURL

dgraphtest/zero_state.go:34–43  ·  view source on GitHub ↗

GetZeroStateURL returns the full HTTP URL of a Zero's /state endpoint.

(id int)

Source from the content-addressed store, hash-verified

32
33// GetZeroStateURL returns the full HTTP URL of a Zero's /state endpoint.
34func (c *LocalCluster) GetZeroStateURL(id int) (string, error) {
35 if id >= c.conf.numZeros {
36 return "", fmt.Errorf("invalid id of zero: %v", id)
37 }
38 pubPort, err := publicPort(c.dcli, c.zeros[id], zeroHttpPort)
39 if err != nil {
40 return "", err
41 }
42 return "http://0.0.0.0:" + pubPort + "/state", nil
43}
44
45// GetZeroState queries the /state endpoint on the specified Zero and returns
46// the parsed membership snapshot.

Callers 1

GetZeroStateMethod · 0.95

Calls 2

publicPortFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected