Includes returns whether the replication set includes the replica with the provided addr.
(addr string)
| 513 | |
| 514 | // Includes returns whether the replication set includes the replica with the provided addr. |
| 515 | func (r ReplicationSet) Includes(addr string) bool { |
| 516 | for _, instance := range r.Instances { |
| 517 | if instance.GetAddr() == addr { |
| 518 | return true |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | return false |
| 523 | } |
| 524 | |
| 525 | // GetIDs returns the IDs of all instances within the replication set. Returned slice |
| 526 | // order is not guaranteed. |