tuple

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIndexOutOfBoundsError

func IsIndexOutOfBoundsError(err error) bool

IsIndexOutOfBoundsError returns true if input error is type of "IndexOutOfBounds".

Types

type Tuple

type Tuple interface {
	// First returns the first element in the Tuple.
	First() (reactor.Any, error)
	// Second returns the second element in the Tuple.
	Second() (reactor.Any, error)
	// Last returns the last element in the Tuple.
	Last() (reactor.Any, error)
	// Get returns the element in the Tuple with given index.
	Get(index int) (reactor.Any, error)
	// GetValue returns value of the element in the Tuple with given index.
	GetValue(index int) reactor.Any
	// Len returns the length of Tuple.
	Len() int
	// HasError returns true if Tuple contains error.
	HasError() bool
	// ForEach execute callback for each element in the Tuple.
	// If ok returns false, current loop will be broken.
	ForEach(callback func(v reactor.Any, e error) (ok bool))
	// ForEachWithIndex execute callback for each element and index in the Tuple.
	// If ok returns false, current loop will be broken.
	ForEachWithIndex(callback func(v reactor.Any, e error, index int) (ok bool))
	// CollectSlice collects values to slice.
	CollectSlice(slicePtr interface{}) error
}

Tuple is a container of multi elements.

func NewTuple

func NewTuple(items ...*reactor.Item) Tuple

NewTuple returns a new Tuple.

Jump to

Keyboard shortcuts

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