@@ -137,6 +137,14 @@ type ClientOption struct {
137
137
// NOTE: This function must be used with the SendToReplicas function.
138
138
ReplicaSelector func (slot uint16 , replicas []NodeInfo ) int
139
139
140
+ // ReadNodeSelector returns index of node selected for a read only command.
141
+ // If set, ReadNodeSelector is prioritized over ReplicaSelector.
142
+ // If the returned index is out of range, the primary node will be selected.
143
+ // The function is called only when SendToReplicas returns true.
144
+ // Each NodeInfo must not be modified.
145
+ // NOTE: This function can't be used with ReplicaSelector option.
146
+ ReadNodeSelector func (slot uint16 , nodes []NodeInfo ) int
147
+
140
148
// Sentinel options, including MasterSet and Auth options
141
149
Sentinel SentinelOption
142
150
@@ -269,14 +277,6 @@ type ClientOption struct {
269
277
// EnableReplicaAZInfo enables the client to load the replica node's availability zone.
270
278
// If true, the client will set the `AZ` field in `ReplicaInfo`.
271
279
EnableReplicaAZInfo bool
272
-
273
- // ReadNodeSelector returns index of node selected for a read only command.
274
- // If set, ReadNodeSelector is prioritized over ReplicaSelector.
275
- // If the returned index is out of range, the primary node will be selected.
276
- // The function is called only when SendToReplicas returns true.
277
- // Each NodeInfo must not be modified.
278
- // NOTE: This function can't be used with ReplicaSelector option.
279
- ReadNodeSelector func (slot uint16 , nodes []NodeInfo ) int
280
280
}
281
281
282
282
// SentinelOption contains MasterSet,
@@ -313,9 +313,9 @@ type StandaloneOption struct {
313
313
314
314
// NodeInfo is the information of a replica node in a redis cluster.
315
315
type NodeInfo struct {
316
+ conn conn
316
317
Addr string
317
318
AZ string
318
- conn conn
319
319
}
320
320
321
321
// ReplicaInfo is the information of a replica node in a redis cluster.
0 commit comments