Class StorageConfig

java.lang.Object
io.floci.testcontainers.config.StorageConfig

public class StorageConfig extends Object
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();
 
  • Method Details

    • builder

      public static StorageConfig.Builder builder()
      Returns a new StorageConfig.Builder for this configuration.
      Returns:
      a new builder
    • toBuilder

      public StorageConfig.Builder toBuilder()
      Returns a new StorageConfig.Builder for this configuration, initialized with the current values of this instance.
      Returns:
      a new builder pre-populated with this configuration's values
    • getHostPersistentPath

      public Optional<Path> getHostPersistentPath()
      Returns the host path that is bind-mounted (read-write) into the Floci container at /app/data for persistent storage.

      When present, the path is also exported as the FLOCI_STORAGE_HOST_PERSISTENT_PATH environment 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. In memory storage mode volumes are always removed regardless of this flag. Defaults to false to match real AWS behaviour (data survives delete).

      Returns:
      true if 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