- Source
Methods
(inner) Connect(host, port, password) → {boolean}
Connect tries to connect redis server with password
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host of the redis server. |
port | number | The port of the redis server. |
password | string | The password for the redis server. |
- Source
Throws:
- - The error encountered during connection.
- Type
- error
Returns:
- The status of the connection.
- Type:
- boolean
Example
let m = require('nuclei/redis');
let status = m.Connect('localhost', 6379, 'password');
(inner) GetServerInfo(host, port) → {string}
GetServerInfo returns the server info for a redis server
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host of the redis server. |
port | number | The port of the redis server. |
- Source
Throws:
- - The error encountered during getting server info.
- Type
- error
Returns:
- The server info.
- Type:
- string
Example
let m = require('nuclei/redis');
let info = m.GetServerInfo('localhost', 6379);
(inner) GetServerInfoAuth(host, port, password) → {string}
GetServerInfoAuth returns the server info for a redis server
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host of the redis server. |
port | number | The port of the redis server. |
password | string | The password for the redis server. |
- Source
Throws:
- - The error encountered during getting server info.
- Type
- error
Returns:
- The server info.
- Type:
- string
Example
let m = require('nuclei/redis');
let info = m.GetServerInfoAuth('localhost', 6379, 'password');
(inner) IsAuthenticated(host, port) → {boolean}
IsAuthenticated checks if the redis server requires authentication
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host of the redis server. |
port | number | The port of the redis server. |
- Source
Throws:
- - The error encountered during checking authentication.
- Type
- error
Returns:
- The authentication status.
- Type:
- boolean
Example
let m = require('nuclei/redis');
let isAuthenticated = m.IsAuthenticated('localhost', 6379);
(inner) RunLuaScript(host, port, password, script)
RunLuaScript runs a lua script on the redis server
Parameters:
Name | Type | Description |
---|---|---|
host | string | The host of the redis server. |
port | number | The port of the redis server. |
password | string | The password for the redis server. |
script | string | The lua script to run. |
- Source
Throws:
- - The error encountered during running the lua script.
- Type
- error
Example
let m = require('nuclei/redis');
m.RunLuaScript('localhost', 6379, 'password', 'return redis.call(\'ping\')');