1 module hunt.redis.RedisPoolOptions; 2 3 import hunt.redis.Protocol; 4 import hunt.util.pool.ObjectPool; 5 6 import std.format; 7 8 /** 9 * 10 */ 11 struct RedisClusterConfig { 12 string[] nodes; 13 uint redirections = 5; 14 } 15 16 /** 17 * 18 */ 19 class RedisPoolOptions : PoolOptions { 20 21 string host = Protocol.DEFAULT_HOST; 22 23 int port = Protocol.DEFAULT_PORT; 24 25 int connectionTimeout = Protocol.DEFAULT_TIMEOUT; 26 27 int soTimeout = Protocol.DEFAULT_TIMEOUT; 28 29 string password; 30 31 int database = Protocol.DEFAULT_DATABASE; 32 33 string clientName = ""; 34 35 int maxAttempts = Protocol.DEFAULT_MAX_ATTEMPTS; 36 37 bool ssl = false; 38 39 this() { 40 name = "RedisPool"; 41 clientName = "default-client"; 42 } 43 44 this(RedisPoolOptions other) { 45 host = other.host; 46 port = other.port; 47 connectionTimeout = other.connectionTimeout; 48 soTimeout = other.soTimeout; 49 password = other.password; 50 database = other.database; 51 clientName = other.clientName; 52 maxAttempts = other.maxAttempts; 53 ssl = other.ssl; 54 } 55 56 override string toString() { 57 return format("Host: %s:%d Timeout: %s", host, port, connectionTimeout); 58 } 59 }