Includes returns whether the replication set includes the replica with the provided addr.
(addr string)
| 109 | |
| 110 | // Includes returns whether the replication set includes the replica with the provided addr. |
| 111 | func (r ReplicationSet) Includes(addr string) bool { |
| 112 | for _, instance := range r.Instances { |
| 113 | if instance.GetAddr() == addr { |
| 114 | return true |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | return false |
| 119 | } |
| 120 | |
| 121 | // GetAddresses returns the addresses of all instances within the replication set. Returned slice |
| 122 | // order is not guaranteed. |