MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / build_store

Function build_store

nodedb/src/wal/audit_archive.rs:32–49  ·  view source on GitHub ↗

Build an object_store S3 client from config.

(config: &AuditArchiveConfig)

Source from the content-addressed store, hash-verified

30
31/// Build an object_store S3 client from config.
32fn build_store(config: &AuditArchiveConfig) -> crate::Result<object_store::aws::AmazonS3> {
33 let mut builder = AmazonS3Builder::new()
34 .with_bucket_name(&config.bucket)
35 .with_region(&config.region);
36
37 if let Some(ref endpoint) = config.endpoint {
38 builder = builder
39 .with_endpoint(endpoint)
40 .with_virtual_hosted_style_request(false);
41 }
42
43 // Credentials from environment (AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY)
44 // or IAM role (EC2/ECS).
45 builder.build().map_err(|e| crate::Error::Storage {
46 engine: "audit_archive".into(),
47 detail: format!("failed to build S3 client: {e}"),
48 })
49}
50
51/// Archive all sealed audit WAL segments to S3.
52///

Callers 1

archive_audit_segmentsFunction · 0.70

Calls 1

buildMethod · 0.45

Tested by

no test coverage detected