As for `ps`, `images`, `network ls` and `volume ls`, this makes it
possible to define a custom default format.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
The formatter.ContainerStats struct exposes its Mutex.
This is a bad design and should be fixed.
To fix that, I separated the statistics
attributes from ContainerStats to StatsEntry and
hid the mutex. Notice that the mutex protects both
the `err` field and the statistics attributes.
Then, implemented SetStatistics, SetError, GetStatistics
and GetError to avoid races.
Moreover, to make this less granular, I decided to
replace the read-write mutex with the regular mutex and
to pass a StatsEntry slice to formatter.ContainerStatsWrite
Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>