1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-07 12:42:55 +03:00

Improve docs

This commit is contained in:
Vladimir Mihailenco
2018-07-18 15:28:51 +03:00
parent da8ef0efa6
commit ee41b90923
2 changed files with 13 additions and 6 deletions

View File

@@ -42,9 +42,11 @@ type ClusterOptions struct {
// It automatically enables ReadOnly.
RouteRandomly bool
// Optional function that is used to load cluster slots information.
// Optional function that returns cluster slots information.
// It is useful to manually create cluster of standalone Redis servers
// or load-balance read/write operations between master and slaves.
// and load-balance read/write operations between master and slaves.
// It can use service like ZooKeeper to maintain configuration information
// and Cluster.ReloadState to manually trigger state reloading.
ClusterSlots func() ([]ClusterSlot, error)
// Following options are copied from Options struct.
@@ -676,7 +678,8 @@ func NewClusterClient(opt *ClusterOptions) *ClusterClient {
return c
}
// ReloadState loads cluster slots information to update cluster topography.
// ReloadState reloads cluster state. It calls ClusterSlots func
// to get cluster slots information.
func (c *ClusterClient) ReloadState() error {
_, err := c.state.Reload()
return err