monitor and fetch folder in real time and uplod it too #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #59
This PR add the following changes:
-d
flag.MonitorAdapter
is added to differntiate adapter with monitoring capability an non-monitorig. All input adapters will be implementing it for now.Monitor
method ofMonitorAdapter
is invoked when-d
flag is provided. If not provided thenFetchSBOMs
is invoked.Monitor
method inMonitorAdapter
interface, fetches SBOMs in real time, when any event is made.Monitor
method to support real-time monitoring.WatcherIterator
to store SBOM in real time. It recieves a SBOM when a newly SBOM is added to a folder or existing SBOM is modified. In bboth cases, the iterator recieves the SBOMs on a real time via channel. Whereas earlierFolderIterator
used to store all SBOMs in one go, and that was fetched in a sequential or parallel manner.FolderIterator
used to upload all SBOM until and unless list becomes exhausted i.eEOF
, butWatcherIterator
doesn't close until and unless the channel is closed. And the channel closes on context cancellation or watcher error orctrl+c
.Although I have tested for
folder
-->interlynk
. it works perfectlly fine. The watcher is trigger in2 cases:In both case, they are feeded to channel, and then it is uploaded.