deislabs / bindle

Bindle: Object Storage for Collections
Apache License 2.0
263 stars 37 forks source link

Add convenience methods for adding a parcel to an invoice in code #357

Open thomastaylor312 opened 1 year ago

thomastaylor312 commented 1 year ago

As a user, I'd like to easily add a file to an invoice without having to manually calculate the sha of a file.

I think we should add the following functions to the Invoice impl:

fn add_parcel(&self, data: &[u8])
fn add_parcel_from_file(&self, file: &File)
fn add_parcel_from_path(&self, path: impl AsRef<Path>)