# GarnetResource.WithPersistence

- Module: [Aspire.Hosting.Garnet](/reference/api/go/aspire.hosting.garnet.md)
- Defined on: [GarnetResource](/reference/api/go/aspire.hosting.garnet/garnetresource.md)
- Version: `17.0.0`
- Kind: `method`

Configures a Garnet container resource for persistence.

## Definition

```go
type GarnetResource interface {
    // ... omitted for brevity
    WithPersistence(options ...*WithPersistenceOptions) GarnetResource
}
```

## Signature

```go
WithPersistence(options ...*WithPersistenceOptions) GarnetResource
```

## Parameters

- `options` (`...*WithPersistenceOptions`) -- optional settings, see [Options](#options)

## Options

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

- `Interval` (`*float64`) -- The interval between snapshot exports. Defaults to 60 seconds.

## Returns

[`GarnetResource`](/reference/api/go/aspire.hosting.garnet/garnetresource.md) -- The resource builder.

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

## Defined on

- [GarnetResource](/reference/api/go/aspire.hosting.garnet/garnetresource.md) -- `handle`
