split out cmd functionality
willscott opened this issue · comments
Will commented
we have a lot of unrelated things going on in the cmd package here.
We should ideally split out:
- full standalone / production-mode operation (e.g.
mirror
) into it's own command that uses this engine library. Utilities we expect providers to run (likeDONE in ipni-cliverify
) into a tools CLI- A simple reference provider of car files that other providers can refer to in order to quickly see how to integrate the engine library.
Masih H. Derkani commented
As in separate provider mirror
into mirror
executable? If so, I am curious why?
Will commented
- reduces surface area of the code in the binary that's deployed / running on the internet
- reduces dependencies / complexity of the download of tools needed for providers running things like
verify
- makes it clear what the reference code path is for people looking at it
Masih H. Derkani commented
Are you thinking we have an executable for each of those? From usability perspective I am not sure it makes sense to do a go install
for each. Re dependencies, How much does it matter when the executable itself is small anyway?
Having said all of this, happy to discuss the restructuring further over a PR; that would help me get my head around the changes.