more consistent naming
diff --git a/openstack/db/v1/configurations/results.go b/openstack/db/v1/configurations/results.go
index a708abd..c52a654 100644
--- a/openstack/db/v1/configurations/results.go
+++ b/openstack/db/v1/configurations/results.go
@@ -32,12 +32,11 @@
}
// ExtractConfigs will retrieve a slice of Config structs from a page.
-func ExtractConfigs(page pagination.Page) ([]Config, error) {
- r := page.(ConfigPage)
+func ExtractConfigs(r pagination.Page) ([]Config, error) {
var s struct {
Configs []Config `json:"configurations"`
}
- err := r.ExtractInto(&s)
+ err := (r.(ConfigPage)).ExtractInto(&s)
return s.Configs, err
}
@@ -100,12 +99,11 @@
}
// ExtractParams will retrieve a slice of Param structs from a page.
-func ExtractParams(page pagination.Page) ([]Param, error) {
- r := page.(ParamPage)
+func ExtractParams(r pagination.Page) ([]Param, error) {
var s struct {
Params []Param `json:"configuration-parameters"`
}
- err := r.ExtractInto(&s)
+ err := (r.(ParamPage)).ExtractInto(&s)
return s.Params, err
}
@@ -117,7 +115,7 @@
// Extract will retrieve a param from an operation result.
func (r ParamResult) Extract() (*Param, error) {
- var s Param
+ var s *Param
err := r.ExtractInto(&s)
- return &s, err
+ return s, err
}
diff --git a/openstack/db/v1/datastores/results.go b/openstack/db/v1/datastores/results.go
index e893884..a6e27d2 100644
--- a/openstack/db/v1/datastores/results.go
+++ b/openstack/db/v1/datastores/results.go
@@ -53,12 +53,11 @@
// ExtractDatastores retrieves a slice of datastore structs from a paginated
// collection.
-func ExtractDatastores(page pagination.Page) ([]Datastore, error) {
- r := page.(DatastorePage)
+func ExtractDatastores(r pagination.Page) ([]Datastore, error) {
var s struct {
Datastores []Datastore `json:"datastores"`
}
- err := r.ExtractInto(&s)
+ err := (r.(DatastorePage)).ExtractInto(&s)
return s.Datastores, err
}
@@ -83,12 +82,11 @@
}
// ExtractVersions retrieves a slice of versions from a paginated collection.
-func ExtractVersions(page pagination.Page) ([]Version, error) {
- r := page.(VersionPage)
+func ExtractVersions(r pagination.Page) ([]Version, error) {
var s struct {
Versions []Version `json:"versions"`
}
- err := r.ExtractInto(&s)
+ err := (r.(VersionPage)).ExtractInto(&s)
return s.Versions, err
}
diff --git a/openstack/db/v1/flavors/results.go b/openstack/db/v1/flavors/results.go
index d2a5cba..f74f20c 100644
--- a/openstack/db/v1/flavors/results.go
+++ b/openstack/db/v1/flavors/results.go
@@ -58,11 +58,10 @@
}
// ExtractFlavors provides access to the list of flavors in a page acquired from the List operation.
-func ExtractFlavors(page pagination.Page) ([]Flavor, error) {
- r := page.(FlavorPage)
+func ExtractFlavors(r pagination.Page) ([]Flavor, error) {
var s struct {
Flavors []Flavor `json:"flavors"`
}
- err := r.ExtractInto(&s)
+ err := (r.(FlavorPage)).ExtractInto(&s)
return s.Flavors, err
}
diff --git a/openstack/db/v1/instances/results.go b/openstack/db/v1/instances/results.go
index 905b32c..f32632c 100644
--- a/openstack/db/v1/instances/results.go
+++ b/openstack/db/v1/instances/results.go
@@ -109,12 +109,11 @@
// ExtractInstances will convert a generic pagination struct into a more
// relevant slice of Instance structs.
-func ExtractInstances(page pagination.Page) ([]Instance, error) {
- r := page.(InstancePage)
+func ExtractInstances(r pagination.Page) ([]Instance, error) {
var s struct {
Instances []Instance `json:"instances"`
}
- err := r.ExtractInto(&s)
+ err := (r.(InstancePage)).ExtractInto(&s)
return s.Instances, err
}
diff --git a/openstack/db/v1/users/results.go b/openstack/db/v1/users/results.go
index 018b7c3..d12a681 100644
--- a/openstack/db/v1/users/results.go
+++ b/openstack/db/v1/users/results.go
@@ -53,11 +53,10 @@
// ExtractUsers will convert a generic pagination struct into a more
// relevant slice of User structs.
-func ExtractUsers(page pagination.Page) ([]User, error) {
- r := page.(UserPage)
+func ExtractUsers(r pagination.Page) ([]User, error) {
var s struct {
Users []User `json:"users"`
}
- err := r.ExtractInto(&s)
+ err := (r.(UserPage)).ExtractInto(&s)
return s.Users, err
}