Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions page.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ type SimpleShowPage struct {
Shows []FullShow `json:"items"`
}

// pageable is an internal interface for types that support paging
// Pageable is an interface for types that support paging
// by embedding basePage.
type pageable interface{ canPage() }
type Pageable interface{ CanPage() }

func (b *basePage) canPage() {}
func (b *basePage) CanPage() {}

// NextPage fetches the next page of items and writes them into p.
// It returns ErrNoMorePages if p already contains the last page.
func (c *Client) NextPage(ctx context.Context, p pageable) error {
func (c *Client) NextPage(ctx context.Context, p Pageable) error {
if p == nil || reflect.ValueOf(p).IsNil() {
return fmt.Errorf("spotify: p must be a non-nil pointer to a page")
}
Expand All @@ -139,7 +139,7 @@ func (c *Client) NextPage(ctx context.Context, p pageable) error {

// PreviousPage fetches the previous page of items and writes them into p.
// It returns ErrNoMorePages if p already contains the last page.
func (c *Client) PreviousPage(ctx context.Context, p pageable) error {
func (c *Client) PreviousPage(ctx context.Context, p Pageable) error {
if p == nil || reflect.ValueOf(p).IsNil() {
return fmt.Errorf("spotify: p must be a non-nil pointer to a page")
}
Expand Down