blob: ae57e1886c9357103684638f772522f3060e0629 [file] [log] [blame]
Ash Wilsonc8e68872014-09-16 10:36:56 -04001package pagination
2
3// nullPage is an always-empty page that trivially satisfies all Page interfacts.
4// It's useful to be returned along with an error.
5type nullPage struct{}
6
7// NextPageURL always returns "" to indicate that there are no more pages to return.
8func (p nullPage) NextPageURL() (string, error) {
9 return "", nil
10}
11
12// IsEmpty always returns true to prevent iteration over nullPages.
13func (p nullPage) IsEmpty() (bool, error) {
14 return true, nil
15}
16
17// LastMark always returns "" because the nullPage contains no items to have a mark.
18func (p nullPage) LastMark() (string, error) {
19 return "", nil
20}