diff --git a/Guides/Fridge.diagram.md b/Guides/Fridge.diagram.md new file mode 100644 index 0000000..436f177 --- /dev/null +++ b/Guides/Fridge.diagram.md @@ -0,0 +1,46 @@ +# Fridge architecture +Diagram below can be used to depict the structural layout of the Fridge library. + +```mermaid +graph TD +A[Fridge] --> B +B{Struct} +B --> E(Encodable) +B --> D(Decodable) +E --> |identifier|freeze +D --> |URL|F[grab] +D --> |identifier|G[unfreeze] +``` + +## Network interface perspective +You can observer `Fridge` interface from the point of network in following way: + +```mermaid +graph TD +N[Network] ==> 1(Fridge) +1 --> |url|grab +``` + +By providing `url` or `urlRequest` objects (and conforming your struct to `Encodable`) you can `grab` network objects easily. + +Keywords: +**`url`**, **`grab`** + +## Storage interface perspective +```mermaid +graph TD +S[Storage] ==> F +F{Fridge} +F --> |identifier|U(unfreeze) +F --> |identifier|R(freeze) +B[BSON] +U --> B +R --> B +``` + +Keywords: +**`identifier`**, **`freeze`**, **`unfreeze`** + +--- +Copyright (c) by Vexy 2022 +Effective since: `2022-03-13` diff --git a/Guides/Usage.md b/Guides/Usage.md index bb8a8d5..b2339e7 100644 --- a/Guides/Usage.md +++ b/Guides/Usage.md @@ -5,7 +5,7 @@ In short, following guide describes **how to**: - [load/store an object](#data-handling) - [handle errors](#error-handling) - +Checkout architecture overview in separate [diagram](Guides/Fridge.diagram.md) file. For more information, you can always check provided, `in-code` documentation. --- @@ -96,4 +96,4 @@ If your store identifier cannot be found `Fridge` will throw an Error. Check the ## ⛔️ Error Handling Each of the Fridge method, is internally marked with `throws` keyword. Here's what you can deal with: -// list all errors here \ No newline at end of file +// list all errors here diff --git a/README.md b/README.md index 9a4c24b..67a5c75 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,12 @@
- Fridge - perhaps the silliest Swift5 async/await
fetch-and-store implementation you'll ever see !
- Let your fancy struct
(s) raise and shine again, allowing you to focus on 💬 🥊🤖⭐️🗝 stuff.
+ Fridge
- Lightweight, asnyc and extreeemely simple to use fetch or store mechanism.
+
+ Let your fancy struct
(s) raise and shine again, while focusing on 💬 🥊🤖⭐️🗝 other important stuff.
- - -
-