djdv / go-filesystem-utils

ISC License
10 stars 2 forks source link

Add list cmd #4

Closed djdv closed 2 years ago

djdv commented 3 years ago

This works but is not final. Bind/mount need to be implemented first, then this patch can be refactored and merged with it. As-is, fs list will successfully connect to a file system daemon, or spawn one and use it. But only prints out that no instances are active since we haven't mounted any. (However, if you mock mount response values in the List interface, they will be formatted and render as expected)

Components shared with this and bind/mount will probably go into a prior patch that both can rebase onto before being merged in tandem.

The formats package is looking like a mistake. The list specific format logic should go back into list.go, and the rest should probably be broken up. Not sure yet. Maybe it will be better to have everything related to rendering and transfomation in one package, except postrun methods and type definitions for them.

djdv commented 2 years ago

Closing because this is ancient. This was originally the first concept for how we should manage state in the daemon and it changed drastically over time. This feature will be done again in a different PR later.