func New(fn ListPageFunc) *ListPager {
	return &ListPager{
		PageSize:          defaultPageSize,
		PageFn:            fn,
		FullListIfExpired: true,
	}
}
New creates a new pager from the provided pager function using the default
options. It will fall back to a full list if an expiration error is encountered
as a last resort.
package pager
import (
	"fmt"
	"golang.org/x/net/context"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/api/meta"
	metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
)
const defaultPageSize = 500
type ListPageFunc func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error)
func SimplePageFunc(fn func(opts metav1.ListOptions) (runtime.Object, error)) ListPageFunc {
	return func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error) {
		return fn(opts)
	}
}
type ListPager struct {
	PageSize int64
	PageFn   ListPageFunc
	FullListIfExpired bool
}