Skip to content

Commit 6b90452

Browse files
More cleanup
1 parent 8415d24 commit 6b90452

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/vitess/api_client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ type Tablet struct {
1818
Type topodata.TabletType `json:"type,omitempty"`
1919
}
2020

21-
// isReplica returns a bool reflecting if a tablet type is REPLICA
22-
func (t Tablet) isReplica() bool {
21+
// IsValidReplica returns a bool reflecting if a tablet type is REPLICA
22+
func (t Tablet) IsValidReplica() bool {
2323
return t.Type == topodata.TabletType_REPLICA
2424
}
2525

@@ -40,15 +40,15 @@ func constructAPIURL(api string, keyspace string, shard string) (url string) {
4040
// filterReplicaTablets parses a list of tablets, returning replica tablets only
4141
func filterReplicaTablets(tablets []Tablet) (replicas []Tablet) {
4242
for _, tablet := range tablets {
43-
if tablet.isReplica() {
43+
if tablet.IsValidReplica() {
4444
replicas = append(replicas, tablet)
4545
}
4646
}
4747
return replicas
4848
}
4949

5050
// ParseTablets reads from vitess /api/ks_tablets/<keyspace>/[shard] and returns a
51-
// listing (mysql_hostname, mysql_port) of REPLICA tablets
51+
// listing (mysql_hostname, mysql_port, type) of REPLICA tablets
5252
func ParseTablets(api string, keyspace string, shard string) (tablets []Tablet, err error) {
5353
url := constructAPIURL(api, keyspace, shard)
5454
resp, err := httpClient.Get(url)

0 commit comments

Comments
 (0)