Commit graph

8 commits

Author SHA1 Message Date
Stephen J Day
92dca269f0 Change errors export from Descriptors to ErrorDescriptors 2014-12-12 15:36:15 -08:00
Stephen J Day
e14e5d14b1 Correct documentation errors in urls package 2014-12-12 15:36:15 -08:00
Stephen J Day
9b872ca150 Prepare urls.URLBuilder package for export
The URLBuilder is now exported with documentation for its behavior. Its a light
wrapper around gorilla mux that avoids one having to remember exact arguments
take by each route.
2014-12-12 15:36:15 -08:00
Stephen J Day
e5b6da80d0 Move urls.go into urls package 2014-12-12 15:36:15 -08:00
Stephen J Day
da19114d1a Prepare urls package for exports
The route definition files have been prepared for export with documentation.
Consts have been updated and tests are now passing for the urls package.
2014-12-12 15:36:15 -08:00
Stephen J Day
c78d173cf7 Move routes to urls package
To lock down V2 api routing, we are moving it to a separate package, with an
exported router creation function and route names. Updates will follow to
prepare the package for export.
2014-12-12 15:36:15 -08:00
Stephen J Day
b721b0a15c Export error descriptors and provide tool generate markdown table
To support accurate specification generation, this changeset includes a quick
and dirty tool to generate a markdown table of error codes generated by the
registry API. Equivalent supports for routes will likely follow.

Exported descriptors could be used to generate other documentation, as well.
2014-12-10 16:41:43 -08:00
Stephen J Day
7b56d10076 Lock down HTTP API error codes
This commit locks down the set of http error codes that will be part of the
inital V2 specification, proposed in docker/docker#9015. The naming order has
been slightly changed and there are few tweaks to ensure all conditions are
captured but this will be set the docker core will be impleemnted against.

To support this, the errors have been moved into an api/errors package. A new
type, ErrorDescriptor, has been defined to centralize the code, message and
definitions used with each type. The information therein can be used to
generate documentation and response code mappings (yet to come...).

In addition to the refactoring that came along with this change, several tests
have been added to ensure serialization round trips are reliable. This allows
better support for using these error types on the client and server side. This
is coupled with some tweaks in the client code to fix issues with error
reporting.

Other fixes in the client include moving client-specific errors out of the base
package and ensuring that we have correct parameters for finishing uploads.
2014-12-10 11:49:04 -08:00