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

Method Simple

universal.go:286–341  ·  view source on GitHub ↗

Simple returns basic options created from the universal options.

()

Source from the content-addressed store, hash-verified

284
285// Simple returns basic options created from the universal options.
286func (o *UniversalOptions) Simple() *Options {
287 addr := "127.0.0.1:6379"
288 if len(o.Addrs) > 0 {
289 addr = o.Addrs[0]
290 }
291
292 return &Options{
293 Addr: addr,
294 ClientName: o.ClientName,
295 Dialer: o.Dialer,
296 OnConnect: o.OnConnect,
297
298 DB: o.DB,
299 Protocol: o.Protocol,
300 Username: o.Username,
301 Password: o.Password,
302 CredentialsProvider: o.CredentialsProvider,
303 CredentialsProviderContext: o.CredentialsProviderContext,
304 StreamingCredentialsProvider: o.StreamingCredentialsProvider,
305
306 MaxRetries: o.MaxRetries,
307 MinRetryBackoff: o.MinRetryBackoff,
308 MaxRetryBackoff: o.MaxRetryBackoff,
309
310 DialTimeout: o.DialTimeout,
311 DialerRetries: o.DialerRetries,
312 DialerRetryTimeout: o.DialerRetryTimeout,
313 ReadTimeout: o.ReadTimeout,
314 WriteTimeout: o.WriteTimeout,
315
316 ContextTimeoutEnabled: o.ContextTimeoutEnabled,
317
318 ReadBufferSize: o.ReadBufferSize,
319 WriteBufferSize: o.WriteBufferSize,
320
321 PoolFIFO: o.PoolFIFO,
322 PoolSize: o.PoolSize,
323 MaxConcurrentDials: o.MaxConcurrentDials,
324 PoolTimeout: o.PoolTimeout,
325 MinIdleConns: o.MinIdleConns,
326 MaxIdleConns: o.MaxIdleConns,
327 MaxActiveConns: o.MaxActiveConns,
328 ConnMaxIdleTime: o.ConnMaxIdleTime,
329 ConnMaxLifetime: o.ConnMaxLifetime,
330 ConnMaxLifetimeJitter: o.ConnMaxLifetimeJitter,
331
332 TLSConfig: o.TLSConfig,
333
334 DisableIdentity: o.DisableIdentity,
335 DisableIndentity: o.DisableIndentity,
336 IdentitySuffix: o.IdentitySuffix,
337 UnstableResp3: o.UnstableResp3,
338 PushNotificationProcessor: o.PushNotificationProcessor,
339 MaintNotificationsConfig: o.MaintNotificationsConfig,
340 }
341}
342
343// --------------------------------------------------------------------

Callers 1

NewUniversalClientFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected