mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
feat(libstore): add S3 storage class support
Add support for configuring S3 storage class via the storage-class parameter for S3BinaryCacheStore. This allows users to optimize costs by selecting appropriate storage tiers (STANDARD, GLACIER, INTELLIGENT_TIERING, etc.) based on access patterns. The storage class is applied via the x-amz-storage-class header for both regular PUT uploads and multipart upload initiation.
This commit is contained in:
parent
34ac1792f9
commit
bff81009c6
4 changed files with 75 additions and 1 deletions
|
|
@ -122,4 +122,22 @@ TEST(S3BinaryCacheStore, parameterFiltering)
|
|||
EXPECT_EQ(ref.params["priority"], "10");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test storage class configuration
|
||||
*/
|
||||
TEST(S3BinaryCacheStore, storageClassDefault)
|
||||
{
|
||||
S3BinaryCacheStoreConfig config{"s3", "test-bucket", {}};
|
||||
EXPECT_EQ(config.storageClass.get(), "");
|
||||
}
|
||||
|
||||
TEST(S3BinaryCacheStore, storageClassConfiguration)
|
||||
{
|
||||
StringMap params;
|
||||
params["storage-class"] = "GLACIER";
|
||||
|
||||
S3BinaryCacheStoreConfig config("s3", "test-bucket", params);
|
||||
EXPECT_EQ(config.storageClass.get(), "GLACIER");
|
||||
}
|
||||
|
||||
} // namespace nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue