Finish DB docs for Rackspace
diff --git a/rackspace/db/v1/configurations/results.go b/rackspace/db/v1/configurations/results.go
index 5c960b8..98ce25f 100644
--- a/rackspace/db/v1/configurations/results.go
+++ b/rackspace/db/v1/configurations/results.go
@@ -6,6 +6,7 @@
"github.com/rackspace/gophercloud/pagination"
)
+// Config represents a configuration group API resource.
type Config struct {
Created string
Updated string
@@ -18,10 +19,12 @@
Values map[string]interface{}
}
+// ConfigPage contains a page of Config resources in a paginated collection.
type ConfigPage struct {
pagination.SinglePageBase
}
+// IsEmpty indicates whether a ConfigPage is empty.
func (r ConfigPage) IsEmpty() (bool, error) {
is, err := ExtractConfigs(r)
if err != nil {
@@ -30,6 +33,7 @@
return len(is) == 0, nil
}
+// ExtractConfigs will retrieve a slice of Config structs from a page.
func ExtractConfigs(page pagination.Page) ([]Config, error) {
casted := page.(ConfigPage).Body
@@ -45,6 +49,7 @@
gophercloud.Result
}
+// Extract will retrieve a Config resource from an operation result.
func (r commonResult) Extract() (*Config, error) {
if r.Err != nil {
return nil, r.Err
@@ -58,26 +63,32 @@
return &response.Config, err
}
+// GetResult represents the result of a Get operation.
type GetResult struct {
commonResult
}
+// CreateResult represents the result of a Create operation.
type CreateResult struct {
commonResult
}
+// UpdateResult represents the result of an Update operation.
type UpdateResult struct {
gophercloud.ErrResult
}
+// ReplaceResult represents the result of a Replace operation.
type ReplaceResult struct {
gophercloud.ErrResult
}
+// DeleteResult represents the result of a Delete operation.
type DeleteResult struct {
gophercloud.ErrResult
}
+// Param represents a configuration parameter API resource.
type Param struct {
Max int
Min int
@@ -86,10 +97,12 @@
Type string
}
+// ParamPage contains a page of Param resources in a paginated collection.
type ParamPage struct {
pagination.SinglePageBase
}
+// IsEmpty indicates whether a ParamPage is empty.
func (r ParamPage) IsEmpty() (bool, error) {
is, err := ExtractParams(r)
if err != nil {
@@ -98,6 +111,7 @@
return len(is) == 0, nil
}
+// ExtractParams will retrieve a slice of Param structs from a page.
func ExtractParams(page pagination.Page) ([]Param, error) {
casted := page.(ParamPage).Body
@@ -109,10 +123,13 @@
return resp.Params, err
}
+// ParamResult represents the result of an operation which retrieves details
+// about a particular configuration param.
type ParamResult struct {
gophercloud.Result
}
+// Extract will retrieve a param from an operation result.
func (r ParamResult) Extract() (*Param, error) {
if r.Err != nil {
return nil, r.Err