cloud-storage-sync

Crates.iocloud-storage-sync
lib.rscloud-storage-sync
version0.6.0
sourcesrc
created_at2020-04-30 23:13:14.736887
updated_at2021-05-21 13:37:36.800305
descriptionEmbedded rsync-like local files and Google Cloud Storage buckets
homepagehttps://github.com/onsails/cloud-storage-sync
repositoryhttps://github.com/onsails/cloud-storage-sync
max_upload_size
id235979
size36,946
Andrey Kuznetsov (onsails)

documentation

https://docs.rs/cloud-storage-sync

README

cloud-storage-sync

docs

Library to sync files to, from and between Google Cloud Storage buckets

This project depends on cloud-storage-rs crate. To access bucket you need to specify SERVICE_ACCOUNT environment variable which should contain path to the service account json key.

let force_overwrite = false;
let sync = Sync::new(force_overwrite);

for i in 1..=2 {
    let op_count = sync.sync_local_to_gcs(
        "/some/local/file_or_dir", 
        BUCKET,
        "some/directory",
    ).await?;
    
    if i == 2 {
        assert_eq!(op_count, 0); // passes
    }

    let op_count = sync.sync_gcs_to_local(
        BUCKET,
        "myprefix",
        "../some/directory"
    ).await?;
    
    if i == 2 {
        assert_eq!(op_count, 0); // passes
    }
}
Commit count: 103

cargo fmt