iterator

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Overview

Package iterator provides a generic iterator to be used as a building block for typed iterators. In your applications, use the typed iterators returned by the secrethub package.

Index

Constants

This section is empty.

Variables

View Source
var (
	Done = errio.Namespace("iterator").Code("done").Error("there are no more items left")
)

Errors

Functions

This section is empty.

Types

type Iterator

type Iterator struct {
	// contains filtered or unexported fields
}

func New

func New(newPaginator PaginatorConstructor) Iterator

func (*Iterator) Next

func (it *Iterator) Next() (interface{}, error)

type Paginator

type Paginator interface {
	Next() ([]interface{}, error)
}

type PaginatorConstructor

type PaginatorConstructor func() (Paginator, error)

func PaginatorFactory added in v0.27.0

func PaginatorFactory(fetch func() ([]interface{}, error)) PaginatorConstructor

PaginatorFactory returns a paginator constructor that constructs a paginator with the provided fetch function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL