use object_store::ObjectStore;
use object_store::local::LocalFileSystem;
use std::sync::Arc;

/// Initialize the object store backend.
/// Starts with LocalFileSystem. Swap to S3/RustFS by changing this function.
pub fn init_local(root: &str) -> Arc<dyn ObjectStore> {
    std::fs::create_dir_all(root).expect("failed to create storage root");
    Arc::new(LocalFileSystem::new_with_prefix(root).expect("failed to init local object store"))
}
