# GarnetResource

- Module: [Aspire.Hosting.Garnet](/reference/api/go/aspire.hosting.garnet.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

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

## Definition

```go
type GarnetResource interface {
    ExpressionValue
    IComputeResource
    Resource
    ResourceWithArgs
    ResourceWithConnectionString
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithWaitSupport
}
```

## Embeds

- `ExpressionValue`
- `IComputeResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithConnectionString`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- `ResourceWithWaitSupport`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the Garnet server.
- `Host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- `PasswordParameter`: `ParameterResource` `get` -- Gets the parameter that contains the Garnet server password.
- `Port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- `PrimaryEndpoint`: `EndpointReference` `get` -- Gets the primary endpoint for the Garnet server.
- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property
- `UriExpression`: `*ReferenceExpression` `get` -- Gets the connection URI expression for the Garnet server.

## Methods

- [WithDataBindMount](/reference/api/go/aspire.hosting.garnet/garnetresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a Garnet container resource and enables Garnet persistence.
  ```go
  WithDataBindMount(source string, options ...*WithDataBindMountOptions) GarnetResource
  ```
- [WithDataVolume](/reference/api/go/aspire.hosting.garnet/garnetresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a Garnet container resource and enables Garnet persistence.
  ```go
  WithDataVolume(options ...*WithDataVolumeOptions) GarnetResource
  ```
- [WithPersistence](/reference/api/go/aspire.hosting.garnet/garnetresource/withpersistence.md) -- `method` -- Configures a Garnet container resource for persistence.
  ```go
  WithPersistence(options ...*WithPersistenceOptions) GarnetResource
  ```
