client-go: k8s.io/client-go/tools/pager Index | Files

package pager

import "k8s.io/client-go/tools/pager"

Index

Package Files

pager.go

type ListPageFunc Uses

type ListPageFunc func(ctx context.Context, opts metav1.ListOptions) (runtime.Object, error)

ListPageFunc returns a list object for the given list options.

func SimplePageFunc Uses

func SimplePageFunc(fn func(opts metav1.ListOptions) (runtime.Object, error)) ListPageFunc

SimplePageFunc adapts a context-less list function into one that accepts a context.

type ListPager Uses

type ListPager struct {
    PageSize int64
    PageFn   ListPageFunc

    FullListIfExpired bool
}

ListPager assists client code in breaking large list queries into multiple smaller chunks of PageSize or smaller. PageFn is expected to accept a metav1.ListOptions that supports paging and return a list. The pager does not alter the field or label selectors on the initial options list.

func New Uses

func New(fn ListPageFunc) *ListPager

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.

func (*ListPager) List Uses

func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runtime.Object, error)

List returns a single list object, but attempts to retrieve smaller chunks from the server to reduce the impact on the server. If the chunk attempt fails, it will load the full list instead. The Limit field on options, if unset, will default to the page size.

Package pager imports 7 packages (graph) and is imported by 2 packages. Updated 2018-04-08. Refresh now. Tools for package owners.