cluster -> single

This commit is contained in:
2024-06-20 18:38:23 +08:00
parent f11c0a8216
commit e8b63fb863
3 changed files with 16 additions and 33 deletions

View File

@ -7,23 +7,12 @@
// Date : 2024-06-18 16:12
package define
type ClusterOptions struct {
type Options struct {
Network string `json:"network" yaml:"network" ini:"network" toml:"network"` // 网络连接方式
// A seed list of host:port addresses of cluster nodes.
Addrs []string `json:"addrs" yaml:"addrs" ini:"addrs" toml:"addrs"` // 集群IP列表
Addr string `json:"addr" yaml:"addr" ini:"addr" toml:"addr"` // 集群IP列表
// ClientName will execute the `CLIENT SETNAME ClientName` command for each conn.
ClientName string `json:"client_name" yaml:"client_name" ini:"client_name" toml:"client_name"` // 集群名称
// The maximum number of retries before giving up. Command is retried
// on network errors and MOVED/ASK redirects.
// Default is 3 retries.
MaxRedirects int `json:"max_redirects" yaml:"max_redirects" ini:"max_redirects" toml:"max_redirects"` // 最大重试次数
// Enables read-only commands on slave nodes.
ReadOnly bool `json:"read_only" yaml:"read_only" ini:"read_only" toml:"read_only"` // 只读
// Allows routing read-only commands to the closest master or slave node.
// It automatically enables ReadOnly.
RouteByLatency bool `json:"route_by_latency" yaml:"route_by_latency" ini:"route_by_latency" toml:"route_by_latency"`
// Allows routing read-only commands to the random master or slave node.
// It automatically enables ReadOnly.
RouteRandomly bool `json:"route_randomly" yaml:"route_randomly" ini:"route_randomly" toml:"route_randomly"`
Protocol int
Username string `json:"username" yaml:"username" ini:"username" toml:"username"`