more consistent naming
diff --git a/openstack/identity/v2/extensions/admin/roles/results.go b/openstack/identity/v2/extensions/admin/roles/results.go
index 608f206..28de6bb 100644
--- a/openstack/identity/v2/extensions/admin/roles/results.go
+++ b/openstack/identity/v2/extensions/admin/roles/results.go
@@ -26,18 +26,17 @@
}
// IsEmpty determines whether or not a page of Tenants contains any results.
-func (page RolePage) IsEmpty() (bool, error) {
- users, err := ExtractRoles(page)
+func (r RolePage) IsEmpty() (bool, error) {
+ users, err := ExtractRoles(r)
return len(users) == 0, err
}
// ExtractRoles returns a slice of roles contained in a single page of results.
-func ExtractRoles(page pagination.Page) ([]Role, error) {
- r := page.(RolePage)
+func ExtractRoles(r pagination.Page) ([]Role, error) {
var s struct {
Roles []Role `json:"roles"`
}
- err := r.ExtractInto(&s)
+ err := (r.(RolePage)).ExtractInto(&s)
return s.Roles, err
}
diff --git a/openstack/identity/v2/tenants/results.go b/openstack/identity/v2/tenants/results.go
index bf52554..3ce1e67 100644
--- a/openstack/identity/v2/tenants/results.go
+++ b/openstack/identity/v2/tenants/results.go
@@ -26,17 +26,17 @@
}
// IsEmpty determines whether or not a page of Tenants contains any results.
-func (page TenantPage) IsEmpty() (bool, error) {
- tenants, err := ExtractTenants(page)
+func (r TenantPage) IsEmpty() (bool, error) {
+ tenants, err := ExtractTenants(r)
return len(tenants) == 0, err
}
// NextPageURL extracts the "next" link from the tenants_links section of the result.
-func (page TenantPage) NextPageURL() (string, error) {
+func (r TenantPage) NextPageURL() (string, error) {
var s struct {
Links []gophercloud.Link `json:"tenants_links"`
}
- err := page.ExtractInto(&s)
+ err := r.ExtractInto(&s)
if err != nil {
return "", err
}
@@ -44,11 +44,10 @@
}
// ExtractTenants returns a slice of Tenants contained in a single page of results.
-func ExtractTenants(page pagination.Page) ([]Tenant, error) {
- r := page.(TenantPage)
+func ExtractTenants(r pagination.Page) ([]Tenant, error) {
var s struct {
Tenants []Tenant `json:"tenants"`
}
- err := r.ExtractInto(&s)
+ err := (r.(TenantPage)).ExtractInto(&s)
return s.Tenants, err
}
diff --git a/openstack/identity/v2/users/results.go b/openstack/identity/v2/users/results.go
index c353c61..c493383 100644
--- a/openstack/identity/v2/users/results.go
+++ b/openstack/identity/v2/users/results.go
@@ -47,34 +47,32 @@
}
// IsEmpty determines whether or not a page of Tenants contains any results.
-func (page UserPage) IsEmpty() (bool, error) {
- users, err := ExtractUsers(page)
+func (r UserPage) IsEmpty() (bool, error) {
+ users, err := ExtractUsers(r)
return len(users) == 0, err
}
// ExtractUsers returns a slice of Tenants contained in a single page of results.
-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
}
// IsEmpty determines whether or not a page of Tenants contains any results.
-func (page RolePage) IsEmpty() (bool, error) {
- users, err := ExtractRoles(page)
+func (r RolePage) IsEmpty() (bool, error) {
+ users, err := ExtractRoles(r)
return len(users) == 0, err
}
// ExtractRoles returns a slice of Roles contained in a single page of results.
-func ExtractRoles(page pagination.Page) ([]Role, error) {
- r := page.(RolePage)
+func ExtractRoles(r pagination.Page) ([]Role, error) {
var s struct {
Roles []Role `json:"roles"`
}
- err := r.ExtractInto(&s)
+ err := (r.(RolePage)).ExtractInto(&s)
return s.Roles, err
}