RedisResource

Handle
📦 Aspire.Hosting.Redis v17.0.0

A resource that represents a Redis resource independent of the hosting model.

type RedisResource interface {
ExpressionValue
IComputeResource
Resource
ResourceWithArgs
ResourceWithConnectionString
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Properties

propertyConnectionStringExpression*ReferenceExpressionget
Gets the connection string expression for the Redis server.
ConnectionStringExpression() *ReferenceExpression
propertyHostEndpointReferenceExpressionget
Gets the host endpoint reference for this resource.
Host() EndpointReferenceExpression
propertyPasswordParameterParameterResourceget · set
Gets the parameter that contains the Redis server password.
PasswordParameter() ParameterResource
SetPasswordParameter(value ParameterResource) RedisResource
propertyPortEndpointReferenceExpressionget
Gets the port endpoint reference for this resource.
Port() EndpointReferenceExpression
propertyPrimaryEndpointEndpointReferenceget
Gets the primary endpoint for the Redis server.
PrimaryEndpoint() EndpointReference
propertyResourceTypeDisplayNamestringget
Gets the ResourceTypeDisplayName property
ResourceTypeDisplayName() (string, error)
propertyTlsEnabledboolget
Indicates whether TLS is enabled for the Redis server.
TlsEnabled() (bool, error)
propertyUriExpression*ReferenceExpressionget
Gets the connection URI expression for the Redis server.
UriExpression() *ReferenceExpression

Methods

methodWithDataBindMountbuilder
Adds a bind mount for the data folder to a Redis container resource and enables Redis persistence.
WithDataBindMount(
source string,
options ...*WithDataBindMountOptions,
) RedisResource
sourcestringThe source directory on the host to mount into the container.
options...*WithDataBindMountOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDataBindMountOptions argument.

IsReadOnly*boolA flag that indicates if this is a read-only mount. Setting this to true will disable Redis persistence. Defaults to false.
RedisResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithDataVolumebuilder
Adds a named volume for the data folder to a Redis container resource and enables Redis persistence.
WithDataVolume(options ...*WithDataVolumeOptions) RedisResource
options...*WithDataVolumeOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDataVolumeOptions argument.

Name*stringThe name of the volume. Defaults to an auto-generated name based on the application and resource names.
IsReadOnly*boolA flag that indicates if this is a read-only volume. Setting this to true will disable Redis persistence. Defaults to false.
RedisResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithHostPortbuilder
Configures the host port that the Redis resource is exposed on instead of using randomly assigned port.
WithHostPort(port *float64) RedisResource
port*float64The port to bind on the host. If null is used random port will be assigned.
RedisResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithModulebuilder
Configures the Redis resource to use the specified Redis module by providing its path inside the container.
WithModule(path string) RedisResource
pathstringThe absolute path to the Redis module inside the Redis container.
RedisResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithPasswordbuilder
Configures the password that the Redis resource is used.
WithPassword(password ParameterResource) RedisResource
passwordParameterResourceThe parameter used to provide the password for the Redis resource. If null, no password will be configured.
RedisResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithPersistencebuilder
Configures a Redis container resource for persistence.
WithPersistence(options ...*WithPersistenceOptions) RedisResource
options...*WithPersistenceOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithPersistenceOptions argument.

Interval*float64The interval between snapshot exports. Defaults to 60 seconds.
KeysChangedThreshold*float64The number of key change operations required to trigger a snapshot at the interval. Defaults to 1.
RedisResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithRedisCommanderbuilder
Adds Redis Commander management UI
WithRedisCommander(options ...*WithRedisCommanderOptions) RedisResource
options...*WithRedisCommanderOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithRedisCommanderOptions argument.

ConfigureContainerfunc(obj RedisCommanderResource)callbackConfiguration callback for Redis Commander container resource.
ContainerName*stringOverride the container name used for Redis Commander.
RedisResource

Returns a handle; failures surface later via Err().

methodWithRedisInsightbuilder
Adds Redis Insight management UI
WithRedisInsight(options ...*WithRedisInsightOptions) RedisResource
options...*WithRedisInsightOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithRedisInsightOptions argument.

ConfigureContainerfunc(obj RedisInsightResource)callbackConfiguration callback for Redis Insight container resource.
ContainerName*stringOverride the container name used for Redis Insight.
RedisResource

Returns a handle; failures surface later via Err().

methodWithReplbuilder
Adds a REPL command that opens an authenticated Redis shell in the dashboard terminal dock.
WithRepl() RedisResource
RedisResource

The resource builder for chaining.

Returns a handle; failures surface later via Err().