generator

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	// Next prepares a new element, and returns `false` at the end of iteration.
	Next() bool

	// Value returns the value of prepared element.
	Value() interface{}
}

Generator is an interface to be implemented by element providers.

func NewChannel

func NewChannel(chn <-chan interface{}) Generator

Newchannel creates a new instance of `Generator` for channels.

func NewSlice

func NewSlice(elements []interface{}) Generator

Newslice creates a new instance of `Generator` for slices.

Jump to

Keyboard shortcuts

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