Redis
Defines a connection to redis or another redis-compatible key-value store. Utilizes go-redis under the hood.
| Used by the redis cache and bearer authentication. |
Example
-
YAML
-
JSON
datastores:
- name: redis
id: redis-0
mode: ring
servers:
- host: 127.0.0.1
port: 6379
- host: 127.0.0.1
port: 6380
{
"datastores": [
{
"name": "redis",
"id": "redis-0",
"mode": "ring",
"servers": [
{
"host": "127.0.0.1",
"port": 6379
},
{
"host": "127.0.0.1",
"port": 6380
}
]
}
]
}
Configuration
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
|
The unique identifier of the datastore used to reference this datastore elsewhere in configuration |
string |
Yes |
None |
|
The host of the redis server. A convenience equivalent to supplying |
string |
No |
127.0.0.1 |
|
The port of the redis server. A convenience equivalent to supplying |
int |
No |
6379 |
|
Database number, defaults to 0. Unused in cluster mode |
int |
No |
0 |
|
Username to use to authenticate with redis |
string |
No |
None |
|
Password to use to authenticate with redis |
string |
No |
None |
|
Controls operating mode of redis. Can be |
string |
No |
standalone |
|
The list of servers to connect to supplied as an array of objects, each with a host and key parameter. This should only have a single entry when operating in standalone mode. If this is unspecified it uses the standalone |
Array of |
No |
host and port |