GetZeroStateURL returns the full HTTP URL of a Zero's /state endpoint.
(id int)
| 32 | |
| 33 | // GetZeroStateURL returns the full HTTP URL of a Zero's /state endpoint. |
| 34 | func (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. |
no test coverage detected