1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use Duration;
use ;
/// `RedisConfig` represents the configuration for connecting to a Redis instance.
///
/// This configuration object is used to set up a connection pool to Redis, providing
/// necessary details such as the Redis host, port, authentication credentials, and pool settings.
///
/// In more advanced setups, such as Redis clusters or socket connections, the `connection_url` field
/// can be used to provide a direct connection string. If `connection_url` is provided,
/// fields like `host`, `port`, and `db` become optional.
///
/// Configuration fields can be loaded from various sources, such as YAML, JSON
/// configuration files, or from environment variables.
///
/// Example configuration in YAML:
///
/// ```yaml
/// host: localhost
/// port: 6379
/// username: username
/// password: top_secret_password
/// db: 0
/// connection_timeout:
/// secs: 60
/// nanos: 0
/// connection_pool_size: 10
/// ```
///
/// Another example configuration in YAML:
///
/// ```yaml
/// connection_url: "redis://username:password@localhost:6379/0"
/// connection_timeout:
/// secs: 60
/// nanos: 0
/// connection_pool_size: 10
/// ```
///
/// Fields like `connection_timeout` and `connection_pool_size` control how the connection pool behaves.