pynenc.conf.config_redis

Module Contents

Classes

ConfigRedis

Specific Configuration for any Redis client.

API

class pynenc.conf.config_redis.ConfigRedis(config_values: Optional[dict[str, Any]] = None, config_filepath: Optional[str] = None)[source]

Bases: pynenc.conf.config_base.ConfigPynencBase

Specific Configuration for any Redis client.

This class provides configuration settings specific to Redis clients, allowing for customization of the Redis connection used in the system.

Variables:
  • redis_username (ConfigField[str]) – The username to use when connecting to the Redis server. Defaults to an empty string, indicating that no username is provided.

  • redis_password (ConfigField[str]) – The password to use when connecting to the Redis server. Defaults to an empty string, indicating that no password is provided.

  • redis_host (ConfigField[str]) – The hostname of the Redis server. Defaults to ‘localhost’, specifying that the Redis server is expected to be running on the same machine as the client.

  • redis_port (ConfigField[int]) – The port number on which the Redis server is listening. Defaults to 6379, which is the default port for Redis.

  • redis_db (ConfigField[int]) – The database number to connect to on the Redis server. Redis servers typically support multiple databases (numbered from 0), allowing different applications or parts of an application to operate in separate data spaces. Defaults to 0.

  • redis_url (ConfigField[str]) – The URL of the Redis server. This field is intended to be used when the Redis server is accessed via a URL rather than a hostname and port. Defaults to an empty string, indicating that no URL is provided. If specified will override all other connection parameters.

Example usage of the ConfigRedis class involves initializing it with specific values for host, port, and database, or relying on the defaults for a standard Redis setup.

Initialization

redis_username

‘ConfigField(…)’

redis_password

‘ConfigField(…)’

redis_host

‘ConfigField(…)’

redis_port

‘ConfigField(…)’

redis_db

‘ConfigField(…)’

redis_url

‘ConfigField(…)’