To support the hub handling documents in memory using DB abstractions (e.g. inputs are document IDs and not file paths) we need to remove all filesystem code from these documents and place them into external functions.
And move the FS handling into an external visitor which can be applied on to the document. Later we can add a DB visitor which ensure all documents are DB ready.
To support the hub handling documents in memory using DB abstractions (e.g. inputs are document IDs and not file paths) we need to remove all filesystem code from these documents and place them into external functions.
The first attempt will be using a visitor pattern (https://refactoring.guru/design-patterns/visitor/go/example)
And move the FS handling into an external visitor which can be applied on to the document. Later we can add a DB visitor which ensure all documents are DB ready.