MCPcopy
hub / github.com/redis/go-redis / DefaultConfig

Function DefaultConfig

maintnotifications/config.go:136–154  ·  view source on GitHub ↗

DefaultConfig returns a Config with sensible defaults.

()

Source from the content-addressed store, hash-verified

134
135// DefaultConfig returns a Config with sensible defaults.
136func DefaultConfig() *Config {
137 return &Config{
138 Mode: ModeAuto, // Enable by default for Redis Cloud
139 EndpointType: EndpointTypeAuto, // Auto-detect based on connection
140 RelaxedTimeout: 10 * time.Second,
141 HandoffTimeout: 15 * time.Second,
142 MaxWorkers: 0, // Auto-calculated based on pool size
143 HandoffQueueSize: 0, // Auto-calculated based on max workers
144 PostHandoffRelaxedDuration: 0, // Auto-calculated based on relaxed timeout
145
146 // Circuit breaker configuration
147 CircuitBreakerFailureThreshold: 5,
148 CircuitBreakerResetTimeout: 60 * time.Second,
149 CircuitBreakerMaxRequests: 3,
150
151 // Connection Handoff Configuration
152 MaxHandoffRetries: 3,
153 }
154}
155
156// Validate checks if the configuration is valid.
157func (c *Config) Validate() error {

Callers 9

TestConfigFunction · 0.85
TestConfigCloneFunction · 0.85
TestManagerRefactoringFunction · 0.85
CloneMethod · 0.85
createTestManagerFunction · 0.85

Calls

no outgoing calls

Tested by 7

TestConfigFunction · 0.68
TestConfigCloneFunction · 0.68
TestManagerRefactoringFunction · 0.68
createTestManagerFunction · 0.68