From 14e8f2e39f8c05b13375c82c375c1dbfdeb18c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veljko=20Tekelerovi=C4=87?= Date: Sun, 13 Mar 2022 21:42:26 +0100 Subject: [PATCH] Fridge 0.8.9 - Make Freezer and Grabber private (#32) - Rework README (#30) - Updated Guides, README and added separate Fridge diagram quick manual - Updated broken links across the documentation. Fixed incorrect graph display in diagram file - Removed unneeded debug outputs (#29) Closes #29 Closes #30 Closes #32 --- Guides/Fridge.diagram.md | 46 ++++++++++++++++++++++++++++++ Guides/Usage.md | 4 +-- README.md | 35 +++++++++++++---------- Sources/Fridge/BSONConverter.swift | 3 -- Sources/Fridge/Freezer.swift | 3 +- Sources/Fridge/Grabber.swift | 2 +- 6 files changed, 70 insertions(+), 23 deletions(-) create mode 100644 Guides/Fridge.diagram.md 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.

+

-

- profile for Vexy on Stack Exchange, a network of free, community-driven Q&A sites - -

-