Rename ListResult(s) to ListPage.
diff --git a/openstack/compute/v2/flavors/flavors.go b/openstack/compute/v2/flavors/flavors.go
index 4318eb6..b6ad596 100644
--- a/openstack/compute/v2/flavors/flavors.go
+++ b/openstack/compute/v2/flavors/flavors.go
@@ -43,7 +43,7 @@
// ExtractFlavors provides access to the list of flavors in a page acquired from the List operation.
func ExtractFlavors(page pagination.Page) ([]Flavor, error) {
- casted := page.(ListResult).Body
+ casted := page.(ListPage).Body
var flavors []Flavor
cfg := &mapstructure.DecoderConfig{
diff --git a/openstack/compute/v2/flavors/requests.go b/openstack/compute/v2/flavors/requests.go
index 7563d04..c798f17 100644
--- a/openstack/compute/v2/flavors/requests.go
+++ b/openstack/compute/v2/flavors/requests.go
@@ -6,13 +6,13 @@
"github.com/rackspace/gophercloud/pagination"
)
-// ListResult contains a single page of the response from a List call.
-type ListResult struct {
+// ListPage contains a single page of the response from a List call.
+type ListPage struct {
pagination.MarkerPageBase
}
// IsEmpty determines if a page contains any results.
-func (p ListResult) IsEmpty() (bool, error) {
+func (p ListPage) IsEmpty() (bool, error) {
flavors, err := ExtractFlavors(p)
if err != nil {
return true, err
@@ -21,7 +21,7 @@
}
// LastMarker returns the ID field of the final result from this page, to be used as the marker for the next.
-func (p ListResult) LastMarker() (string, error) {
+func (p ListPage) LastMarker() (string, error) {
flavors, err := ExtractFlavors(p)
if err != nil {
return "", err
@@ -59,7 +59,7 @@
// See ListFilterOptions for more details.
func List(client *gophercloud.ServiceClient, lfo ListFilterOptions) pagination.Pager {
createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- p := ListResult{pagination.MarkerPageBase{LastHTTPResponse: r}}
+ p := ListPage{pagination.MarkerPageBase{LastHTTPResponse: r}}
p.MarkerPageBase.Owner = p
return p
}
diff --git a/openstack/compute/v2/images/images.go b/openstack/compute/v2/images/images.go
index c4e838e..0dee058 100644
--- a/openstack/compute/v2/images/images.go
+++ b/openstack/compute/v2/images/images.go
@@ -30,7 +30,7 @@
// ExtractImages converts a page of List results into a slice of usable Image structs.
func ExtractImages(page pagination.Page) ([]Image, error) {
- casted := page.(ListResults).Body
+ casted := page.(ListPage).Body
var results []Image
err := mapstructure.Decode(results, casted)
diff --git a/openstack/compute/v2/images/requests.go b/openstack/compute/v2/images/requests.go
index 22c6e9b..832979c 100644
--- a/openstack/compute/v2/images/requests.go
+++ b/openstack/compute/v2/images/requests.go
@@ -5,14 +5,14 @@
"github.com/rackspace/gophercloud/pagination"
)
-// ListResults contains a single page of results from a List operation.
+// ListPage contains a single page of results from a List operation.
// Use ExtractImages to convert it into a slice of usable structs.
-type ListResults struct {
+type ListPage struct {
pagination.MarkerPageBase
}
// IsEmpty returns true if a page contains no Image results.
-func (page ListResults) IsEmpty() (bool, error) {
+func (page ListPage) IsEmpty() (bool, error) {
images, err := ExtractImages(page)
if err != nil {
return true, err
@@ -20,8 +20,8 @@
return len(images) == 0, nil
}
-// LastMarker returns the ID of the final Image on the current page of ListResults.
-func (page ListResults) LastMarker() (string, error) {
+// LastMarker returns the ID of the final Image on the current page of ListPage.
+func (page ListPage) LastMarker() (string, error) {
images, err := ExtractImages(page)
if err != nil {
return "", err
@@ -35,7 +35,7 @@
// List enumerates the available images.
func List(client *gophercloud.ServiceClient) pagination.Pager {
createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- p := ListResults{pagination.MarkerPageBase{LastHTTPResponse: r}}
+ p := ListPage{pagination.MarkerPageBase{LastHTTPResponse: r}}
p.MarkerPageBase.Owner = p
return p
}
diff --git a/openstack/compute/v2/servers/requests.go b/openstack/compute/v2/servers/requests.go
index e2875e3..462525a 100644
--- a/openstack/compute/v2/servers/requests.go
+++ b/openstack/compute/v2/servers/requests.go
@@ -8,15 +8,15 @@
"github.com/rackspace/gophercloud/pagination"
)
-// ListResult abstracts the raw results of making a List() request against the API.
+// ListPage abstracts the raw results of making a List() request against the API.
// As OpenStack extensions may freely alter the response bodies of structures returned to the client, you may only safely access the
// data provided through the ExtractServers call.
-type ListResult struct {
+type ListPage struct {
pagination.MarkerPageBase
}
// IsEmpty returns true if a page contains no Server results.
-func (page ListResult) IsEmpty() (bool, error) {
+func (page ListPage) IsEmpty() (bool, error) {
servers, err := ExtractServers(page)
if err != nil {
return true, err
@@ -25,7 +25,7 @@
}
// LastMarker returns the ID of the final server on the current page.
-func (page ListResult) LastMarker() (string, error) {
+func (page ListPage) LastMarker() (string, error) {
servers, err := ExtractServers(page)
if err != nil {
return "", err
@@ -44,7 +44,7 @@
// List makes a request against the API to list servers accessible to you.
func List(client *gophercloud.ServiceClient) pagination.Pager {
createPage := func(r pagination.LastHTTPResponse) pagination.Page {
- p := ListResult{pagination.MarkerPageBase{LastHTTPResponse: r}}
+ p := ListPage{pagination.MarkerPageBase{LastHTTPResponse: r}}
p.MarkerPageBase.Owner = p
return p
}
diff --git a/openstack/compute/v2/servers/servers.go b/openstack/compute/v2/servers/servers.go
index 865c7d1..e2352ce 100644
--- a/openstack/compute/v2/servers/servers.go
+++ b/openstack/compute/v2/servers/servers.go
@@ -64,7 +64,7 @@
// ExtractServers interprets the results of a single page from a List() call, producing a slice of Server entities.
func ExtractServers(page pagination.Page) ([]Server, error) {
- casted := page.(ListResult).Body
+ casted := page.(ListPage).Body
var servers []Server
err := mapstructure.Decode(servers, casted)
return servers, err