// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include namespace zen { struct HydrationConfig { // Location of server state to hydrate/dehydrate std::filesystem::path ServerStateDir; // Temporary directory available for use during hydration/dehydration std::filesystem::path TempDir; // Module ID of the server state being hydrated/dehydrated std::string ModuleId; // Back-end specific target specification (e.g. S3 bucket, file path, etc) std::string TargetSpecification; // Optional S3 endpoint override (e.g. "http://localhost:9000" for MinIO). std::string S3Endpoint; // Use path-style S3 URLs (endpoint/bucket/key) instead of virtual-hosted-style // (bucket.endpoint/key). Required for MinIO and other non-AWS endpoints. bool S3PathStyle = false; }; /** * @brief State hydration strategy interface * * An instance of this interface is used to perform hydration OR * dehydration of server state. It's expected to be used only once * and not reused. * */ struct HydrationStrategyBase { virtual ~HydrationStrategyBase() = default; virtual void Dehydrate() = 0; virtual void Hydrate() = 0; virtual void Configure(const HydrationConfig& Config) = 0; }; std::unique_ptr CreateHydrator(const HydrationConfig& Config); #if ZEN_WITH_TESTS void hydration_forcelink(); #endif // ZEN_WITH_TESTS } // namespace zen