Skip to content

Commit 739937e

Browse files
committed
Update documentation
1 parent dbb5ac1 commit 739937e

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

storage.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,35 @@ const (
6262
lockRefreshInterval = 3 * time.Second
6363
)
6464

65-
// RedisStorage implements Redis storage plugin functionality for Caddy.
66-
// It supports connecting to standalone, Cluster, or Sentinal (Failover) Redis servers.
65+
// RedisStorage implements a Caddy storage backend for Redis
66+
// It supports Single (Standalone), Cluster, or Sentinal (Failover) Redis server configurations.
6767
type RedisStorage struct {
68+
// ClientType specifies the Redis client type. Valid values are "cluster" or "failover"
6869
ClientType string `json:"client_type"`
70+
// Address The full address of the Redis server. Example: "127.0.0.1:6379"
71+
// If not defined, will be generated from Host and Port parameters.
6972
Address []string `json:"address"`
73+
// Host The Redis server hostname or IP address. Default: "127.0.0.1"
7074
Host []string `json:"host"`
75+
// Host The Redis server port number. Default: "6379"
7176
Port []string `json:"port"`
77+
// DB The Redis server database number. Default: 0
7278
DB int `json:"db"`
79+
// Timeout The Redis server timeout in seconds. Default: 5
7380
Timeout string `json:"timeout"`
81+
// Username The username for authenticating with the Redis server. Default: "" (No authentication)
7482
Username string `json:"username"`
83+
// Password The password for authenticating with the Redis server. Default: "" (No authentication)
7584
Password string `json:"password"`
85+
// MasterName Only required when connecting to Redis via Sentinal (Failover mode). Default ""
7686
MasterName string `json:"master_name"`
87+
// KeyPrefix A string prefix that is appended to Redis keys. Default: "caddy"
88+
// Useful when the Redis server is used by multiple applications.
7789
KeyPrefix string `json:"key_prefix"`
90+
// EncryptionKey A key string used to symmetrically encrypt and decrypt data stored in Redis.
91+
// The key must be exactly 32 characters, longer values will be truncated. Default: "" (No encryption)
7892
EncryptionKey string `json:"encryption_key"`
93+
// Compression Specifies whether values should be compressed before storing in Redis. Default: false
7994
Compression bool `json:"compression"`
8095
// TlsEnabled controls whether TLS will be used to connect to the Redis
8196
// server. False by default.
@@ -98,7 +113,9 @@ type RedisStorage struct {
98113
// `x509.CertPool.AppendCertsFromPem` for details.
99114
// https://pkg.go.dev/crypto/x509#CertPool.AppendCertsFromPEM
100115
TlsServerCertsPath string `json:"tls_server_certs_path"`
116+
// RouteByLatency Route commands by latency, only used in Cluster mode. Default: false
101117
RouteByLatency bool `json:"route_by_latency"`
118+
// RouteRandomly Route commands randomly, only used in Cluster mode. Default: false
102119
RouteRandomly bool `json:"route_randomly"`
103120

104121
client redis.UniversalClient

0 commit comments

Comments
 (0)