Package io.floci.testcontainers.config
Class StorageConfig
java.lang.Object
io.floci.testcontainers.config.StorageConfig
Storage-related configuration for the Floci server.
Instances are created via StorageConfig.Builder:
StorageConfig config = StorageConfig.builder()
.hostPersistentPath(Path.of("/tmp/floci-data"))
.pruneVolumesOnDelete(true)
.build();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this storage configuration to the given container by setting the appropriate environment variables.static StorageConfig.Builderbuilder()Returns a newStorageConfig.Builderfor this configuration.Returns the host path that is bind-mounted (read-write) into the Floci container at/app/datafor persistent storage.booleanReturns whether named volumes are removed immediately after a child container stops on resource delete.Returns a newStorageConfig.Builderfor this configuration, initialized with the current values of this instance.
-
Method Details
-
builder
Returns a newStorageConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newStorageConfig.Builderfor this configuration, initialized with the current values of this instance.- Returns:
- a new builder pre-populated with this configuration's values
-
getHostPersistentPath
Returns the host path that is bind-mounted (read-write) into the Floci container at/app/datafor persistent storage.When present, the path is also exported as the
FLOCI_STORAGE_HOST_PERSISTENT_PATHenvironment variable so Floci knows where to place state files. When absent, no persistent volume is mounted and Floci uses ephemeral in-container storage.- Returns:
- the host-side persistent storage path, or
Optional.empty()if not configured
-
isPruneVolumesOnDelete
public boolean isPruneVolumesOnDelete()Returns whether named volumes are removed immediately after a child container stops on resource delete.When
true, named volumes are removed immediately after a child container stops on resource delete. Inmemorystorage mode volumes are always removed regardless of this flag. Defaults tofalseto match real AWS behaviour (data survives delete).- Returns:
trueif volumes are pruned on delete
-
applyEnvVarsToContainer
public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this storage configuration to the given container by setting the appropriate environment variables.- Parameters:
container- the container to configure
-