16 lines
940 B
Markdown
16 lines
940 B
Markdown
|
|
# Phase 3
|
||
|
|
|
||
|
|
For phase 3 we want to start implementing the `close` command. We'll get the tar part working but not worry about encryption yet.
|
||
|
|
|
||
|
|
- Make a new method `perform` on `DrawerOperation` which takes `&self` and returns `Result<(), DrawerError>`.
|
||
|
|
- `perform` should first call `validate` and return the error if there is one.
|
||
|
|
- After that, it should call either `open(&self)` or `close(&self)` depending on the operation type. For now, `open` will just be a `todo!()`
|
||
|
|
- The new `close` method should create a vec<u8> consisting of the contents of the target directory as a tarball (use the tar create we depend on)
|
||
|
|
- After creating the vec, it should write it out to the drawer file path.
|
||
|
|
|
||
|
|
I'm going to add some test data to the project under `tests/` but it's just random data to test, ignore the contents of all those files.
|
||
|
|
|
||
|
|
# Phase 3a
|
||
|
|
|
||
|
|
As a minor improvement, make the `perform_close` method also gzip the contents of the tarball.
|