Rename PaginatedLinksPage as LinkedPage.
Mainly because it's shorter.
diff --git a/collections.go b/collections.go
index 69c1824..ba83965 100644
--- a/collections.go
+++ b/collections.go
@@ -121,11 +121,11 @@
}
}
-// PaginatedLinksPage is a page in a collection that provides navigational "Next" and "Previous" links within its result.
-type PaginatedLinksPage ConcretePage
+// LinkedPage is a page in a collection that provides navigational "Next" and "Previous" links within its result.
+type LinkedPage ConcretePage
// NextPageURL extracts the pagination structure from a JSON response and returns the "next" link, if one is present.
-func (current PaginatedLinksPage) NextPageURL() string {
+func (current LinkedPage) NextPageURL() (string, error) {
type response struct {
Links struct {
Next *string `mapstructure:"next,omitempty"`
@@ -158,7 +158,7 @@
return nil, err
}
- return PaginatedLinksPage(cp), nil
+ return LinkedPage(cp), nil
}
return Pager{
diff --git a/collections_test.go b/collections_test.go
index ea93421..665062b 100644
--- a/collections_test.go
+++ b/collections_test.go
@@ -75,7 +75,7 @@
Ints []int `mapstructure:"ints"`
}
- err := mapstructure.Decode(page.(PaginatedLinksPage).Body, &response)
+ err := mapstructure.Decode(page.(LinkedPage).Body, &response)
if err != nil {
return nil, err
}