Merge pull request #2282 from bgrant0607/docgen

Automatic API generation via go-restful
This commit is contained in:
Daniel Smith
2014-11-14 13:12:25 -08:00
18 changed files with 408 additions and 142 deletions

View File

@@ -63,7 +63,7 @@ func (c *Client) Services(namespace string) ServiceInterface {
// VersionInterface has a method to retrieve the server version.
type VersionInterface interface {
ServerVersion() (*version.Info, error)
ServerAPIVersions() (*version.APIVersions, error)
ServerAPIVersions() (*api.APIVersions, error)
}
// APIStatus is exposed by errors that can be converted to an api.Status object
@@ -92,12 +92,12 @@ func (c *Client) ServerVersion() (*version.Info, error) {
}
// ServerAPIVersions retrieves and parses the list of API versions the server supports.
func (c *Client) ServerAPIVersions() (*version.APIVersions, error) {
func (c *Client) ServerAPIVersions() (*api.APIVersions, error) {
body, err := c.Get().AbsPath("/api").Do().Raw()
if err != nil {
return nil, err
}
var v version.APIVersions
var v api.APIVersions
err = json.Unmarshal(body, &v)
if err != nil {
return nil, fmt.Errorf("Got '%s': %v", string(body), err)