PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TempRedis.TempRedisOptions Class Reference

Options for construction of a TempRedis instance. More...

Static Public Attributes

const string ENV_VAR_DISABLE_DISK = "TEMPREDIS_DISABLE_DISK"
 name of the environment variable which is observed to disable the automatically-enabled feature to store redis data on-disc
const string TEMPREDIS_PORT_HINT = nameof(TEMPREDIS_PORT_HINT)
 Environment variable observed for a preference of port to run on (may make debugging easier). This port is tried first, if set, and ports are sequentially tried after that in the event that it is not available.

Properties

bool AutoStart = true [get, set]
 Auto-start the service on construction? (default true)
string PathToRedisService [get, set]
 Provide a custom path to the redis-server executable (default not set)
RedisLocatorStrategies LocatorStrategies [get, set]
 Strategies which may be employed to locate redis This is a flag set (default: all strategies)
bool EnableSaveToDisk [get, set]
 Enables save-to-disk, which means redis-server should (mostly) survive a crash.
bool BindToLocalhostOnly = true [get, set]
 When enabled (default), only bind to localhost.
int DatabaseCount = 1 [get, set]
 How many databases to provide for (default is 1)
int? PortHint [get, set]
 The preferred port to run on. If set, TempRedis will attempt to start a server on this port. If not available, ports will be sequentially tested from this value upward to find an available one. May make debugging easier.
Action< string > DebugLogger [get, set]
 Set this to get debug logs, eg around startup and restart.

Detailed Description

Options for construction of a TempRedis instance.

Property Documentation

◆ BindToLocalhostOnly

bool PeanutButter.TempRedis.TempRedisOptions.BindToLocalhostOnly = true
getset

When enabled (default), only bind to localhost.

  • preferring 127.0.0.1 over ::1
  • default redis binding is to all interfaces, this option is defaulted to true such that the default TempRedis behavior is to bind to localhost only

◆ EnableSaveToDisk

bool PeanutButter.TempRedis.TempRedisOptions.EnableSaveToDisk
getset
Initial value:
=
(
Environment.GetEnvironmentVariable(ENV_VAR_DISABLE_DISK)
?? "1"
)
.AsBoolean()
const string ENV_VAR_DISABLE_DISK
name of the environment variable which is observed to disable the automatically-enabled feature to st...
Definition TempRedis.cs:228

Enables save-to-disk, which means redis-server should (mostly) survive a crash.

◆ LocatorStrategies

RedisLocatorStrategies PeanutButter.TempRedis.TempRedisOptions.LocatorStrategies
getset
Initial value:
=
RedisLocatorStrategies.DownloadForWindowsIfNecessary
RedisLocatorStrategies
Strategies for resolving a temporary redis server executable.
Definition TempRedis.cs:32
@ FindAsWindowsService
Look for an installed Redis service on windows (does not apply to linux/osx) The service must be call...
Definition TempRedis.cs:42
@ FindInPath
Look for redis-server.exe or redis-server (linux/osx) in the path.
Definition TempRedis.cs:36

Strategies which may be employed to locate redis This is a flag set (default: all strategies)

◆ PortHint

int? PeanutButter.TempRedis.TempRedisOptions.PortHint
getset
Initial value:
=
int.TryParse(Environment.GetEnvironmentVariable(TEMPREDIS_PORT_HINT), out var env)
? env
: null
const string TEMPREDIS_PORT_HINT
Environment variable observed for a preference of port to run on (may make debugging easier)....
Definition TempRedis.cs:282

The preferred port to run on. If set, TempRedis will attempt to start a server on this port. If not available, ports will be sequentially tested from this value upward to find an available one. May make debugging easier.


The documentation for this class was generated from the following file:
  • source/TempDb/PeanutButter.TempRedis/TempRedis.cs