Endpoints lists the registered endpoints for the client.
()
| 166 | |
| 167 | // Endpoints lists the registered endpoints for the client. |
| 168 | func (c *Client) Endpoints() []string { |
| 169 | // copy the slice; protect original endpoints from being changed |
| 170 | c.epMu.RLock() |
| 171 | defer c.epMu.RUnlock() |
| 172 | eps := make([]string, len(c.endpoints)) |
| 173 | copy(eps, c.endpoints) |
| 174 | return eps |
| 175 | } |
| 176 | |
| 177 | // SetEndpoints updates client's endpoints. |
| 178 | func (c *Client) SetEndpoints(eps ...string) { |