Failover returns failover options created from the universal options.
()
| 217 | |
| 218 | // Failover returns failover options created from the universal options. |
| 219 | func (o *UniversalOptions) Failover() *FailoverOptions { |
| 220 | if len(o.Addrs) == 0 { |
| 221 | o.Addrs = []string{"127.0.0.1:26379"} |
| 222 | } |
| 223 | |
| 224 | return &FailoverOptions{ |
| 225 | SentinelAddrs: o.Addrs, |
| 226 | MasterName: o.MasterName, |
| 227 | ClientName: o.ClientName, |
| 228 | |
| 229 | Dialer: o.Dialer, |
| 230 | OnConnect: o.OnConnect, |
| 231 | |
| 232 | DB: o.DB, |
| 233 | Protocol: o.Protocol, |
| 234 | Username: o.Username, |
| 235 | Password: o.Password, |
| 236 | CredentialsProvider: o.CredentialsProvider, |
| 237 | CredentialsProviderContext: o.CredentialsProviderContext, |
| 238 | StreamingCredentialsProvider: o.StreamingCredentialsProvider, |
| 239 | |
| 240 | SentinelUsername: o.SentinelUsername, |
| 241 | SentinelPassword: o.SentinelPassword, |
| 242 | |
| 243 | RouteByLatency: o.RouteByLatency, |
| 244 | RouteRandomly: o.RouteRandomly, |
| 245 | |
| 246 | MaxRetries: o.MaxRetries, |
| 247 | MinRetryBackoff: o.MinRetryBackoff, |
| 248 | MaxRetryBackoff: o.MaxRetryBackoff, |
| 249 | |
| 250 | DialTimeout: o.DialTimeout, |
| 251 | DialerRetries: o.DialerRetries, |
| 252 | DialerRetryTimeout: o.DialerRetryTimeout, |
| 253 | ReadTimeout: o.ReadTimeout, |
| 254 | WriteTimeout: o.WriteTimeout, |
| 255 | |
| 256 | ContextTimeoutEnabled: o.ContextTimeoutEnabled, |
| 257 | |
| 258 | ReadBufferSize: o.ReadBufferSize, |
| 259 | WriteBufferSize: o.WriteBufferSize, |
| 260 | |
| 261 | PoolFIFO: o.PoolFIFO, |
| 262 | PoolSize: o.PoolSize, |
| 263 | MaxConcurrentDials: o.MaxConcurrentDials, |
| 264 | PoolTimeout: o.PoolTimeout, |
| 265 | MinIdleConns: o.MinIdleConns, |
| 266 | MaxIdleConns: o.MaxIdleConns, |
| 267 | MaxActiveConns: o.MaxActiveConns, |
| 268 | ConnMaxIdleTime: o.ConnMaxIdleTime, |
| 269 | ConnMaxLifetime: o.ConnMaxLifetime, |
| 270 | ConnMaxLifetimeJitter: o.ConnMaxLifetimeJitter, |
| 271 | |
| 272 | TLSConfig: o.TLSConfig, |
| 273 | |
| 274 | ReplicaOnly: o.ReadOnly, |
| 275 | |
| 276 | DisableIdentity: o.DisableIdentity, |
no outgoing calls
no test coverage detected