(nodes []string, scheme string, r *replica)
| 740 | } |
| 741 | |
| 742 | func newNodes(nodes []string, scheme string, r *replica) ([]*topology.Node, error) { |
| 743 | hosts := make([]*topology.Node, len(nodes)) |
| 744 | for i, node := range nodes { |
| 745 | addr, err := url.Parse(fmt.Sprintf("%s://%s", scheme, node)) |
| 746 | if err != nil { |
| 747 | return nil, fmt.Errorf("cannot parse `node` %q with `scheme` %q: %w", node, scheme, err) |
| 748 | } |
| 749 | hosts[i] = topology.NewNode(addr, r.cluster.heartBeat, r.cluster.name, r.name) |
| 750 | } |
| 751 | return hosts, nil |
| 752 | } |
| 753 | |
| 754 | func (r *replica) isActive() bool { |
| 755 | // The replica is active if at least a single host is active. |
no test coverage detected