dotcloud/docker — pull request #991 by anthonybishopric (2013-06-22 06:12:21+00:00)
Title: 928 docker clean

This change addresses #928. Sorry about such a large pull request - about 450ish lines are all generated code via [gomock](https://code.google.com/p/gomock/) so really the main changes to look out for are these:

* Added `docker clean` as a feature to remove stale containers. I implemented the help and api calls for it.
* Refactored references to the Server struct to the Server interface. This enabled mocking of the Server's destroy method, which I used in api_test.go for all my test cases. I felt the need to be extremely careful since this is a utility to destroy your containers in bulk :)
* Added mock_server.go, which is entirely auto-generated. I'm not totally enthusiastic about automatic code generation, but I wanted to find a viable mock library. Most of the existing tests seem to be integration tests, and I wanted to change that.

Since this change feels pretty invasive, please let me know what you like / dislike and I will be happy to alter it. Thanks for your consideration!