Documentation ¶
Overview ¶
The package is a library to work with iterators. It contains primitive implementations to iterate over the language embedded types.
Example usage:
package main import ( "fmt" iter "github.com/soven/go-iterate" ) // FibonacciIter is an implementation of iter.IntIterator // iterating over fibonacci numbers. type FibonacciIter struct { cur, next int i, n int } // FibonacciN returns an iterator for n first fibonacci numbers. func FibonacciN(n int) *FibonacciIter { return &FibonacciIter{cur: 0, next: 1, n: n} } func (fib FibonacciIter) HasNext() bool { return fib.i < fib.n } func (fib *FibonacciIter) Next() int { ret := fib.cur fib.cur, fib.next = fib.next, fib.cur+fib.next fib.i++ return ret } func (fib FibonacciIter) Err() error { return nil } func main() { fib10 := FibonacciN(10) fib10Doubled := DoubleInts(fib10) fmt.Println(fib10Doubled) // 0, 2, 2, 4, 6, 10, 16, 26, 42, 68 } func DoubleInts(vv iter.IntIterator) []int { // Set doubling converter. vv = iter.IntConverting(vv, iter.IntConvert(func(v int) (int, error) { return v*2, nil })) // Unroll the iterator to a slice of int. return iter.IntUnroll(vv) }
Index ¶
- Variables
- func ByteDiscard(items ByteIterator) error
- func ByteEnum(items ByteIterator, handlers ...ByteEnumHandler) error
- func ByteEnumSkipUntil(items ByteIterator, untilList ...ByteEnumChecker) error
- func ByteRange(items ByteIterator, handlers ...ByteHandler) error
- func ByteSkipUntil(items ByteIterator, untilList ...ByteChecker) error
- func Discard(items Iterator) error
- func Enum(items Iterator, handlers ...EnumHandler) error
- func EnumSkipUntil(items Iterator, untilList ...EnumChecker) error
- func Int16Discard(items Int16Iterator) error
- func Int16Enum(items Int16Iterator, handlers ...Int16EnumHandler) error
- func Int16EnumSkipUntil(items Int16Iterator, untilList ...Int16EnumChecker) error
- func Int16Range(items Int16Iterator, handlers ...Int16Handler) error
- func Int16SkipUntil(items Int16Iterator, untilList ...Int16Checker) error
- func Int32Discard(items Int32Iterator) error
- func Int32Enum(items Int32Iterator, handlers ...Int32EnumHandler) error
- func Int32EnumSkipUntil(items Int32Iterator, untilList ...Int32EnumChecker) error
- func Int32Range(items Int32Iterator, handlers ...Int32Handler) error
- func Int32SkipUntil(items Int32Iterator, untilList ...Int32Checker) error
- func Int64Discard(items Int64Iterator) error
- func Int64Enum(items Int64Iterator, handlers ...Int64EnumHandler) error
- func Int64EnumSkipUntil(items Int64Iterator, untilList ...Int64EnumChecker) error
- func Int64Range(items Int64Iterator, handlers ...Int64Handler) error
- func Int64SkipUntil(items Int64Iterator, untilList ...Int64Checker) error
- func Int8Discard(items Int8Iterator) error
- func Int8Enum(items Int8Iterator, handlers ...Int8EnumHandler) error
- func Int8EnumSkipUntil(items Int8Iterator, untilList ...Int8EnumChecker) error
- func Int8Range(items Int8Iterator, handlers ...Int8Handler) error
- func Int8SkipUntil(items Int8Iterator, untilList ...Int8Checker) error
- func IntDiscard(items IntIterator) error
- func IntEnum(items IntIterator, handlers ...IntEnumHandler) error
- func IntEnumSkipUntil(items IntIterator, untilList ...IntEnumChecker) error
- func IntRange(items IntIterator, handlers ...IntHandler) error
- func IntSkipUntil(items IntIterator, untilList ...IntChecker) error
- func Range(items Iterator, handlers ...Handler) error
- func RuneDiscard(items RuneIterator) error
- func RuneEnum(items RuneIterator, handlers ...RuneEnumHandler) error
- func RuneEnumSkipUntil(items RuneIterator, untilList ...RuneEnumChecker) error
- func RuneRange(items RuneIterator, handlers ...RuneHandler) error
- func RuneSkipUntil(items RuneIterator, untilList ...RuneChecker) error
- func SkipUntil(items Iterator, untilList ...Checker) error
- func StringDiscard(items StringIterator) error
- func StringEnum(items StringIterator, handlers ...StringEnumHandler) error
- func StringEnumSkipUntil(items StringIterator, untilList ...StringEnumChecker) error
- func StringRange(items StringIterator, handlers ...StringHandler) error
- func StringSkipUntil(items StringIterator, untilList ...StringChecker) error
- func Uint16Discard(items Uint16Iterator) error
- func Uint16Enum(items Uint16Iterator, handlers ...Uint16EnumHandler) error
- func Uint16EnumSkipUntil(items Uint16Iterator, untilList ...Uint16EnumChecker) error
- func Uint16Range(items Uint16Iterator, handlers ...Uint16Handler) error
- func Uint16SkipUntil(items Uint16Iterator, untilList ...Uint16Checker) error
- func Uint32Discard(items Uint32Iterator) error
- func Uint32Enum(items Uint32Iterator, handlers ...Uint32EnumHandler) error
- func Uint32EnumSkipUntil(items Uint32Iterator, untilList ...Uint32EnumChecker) error
- func Uint32Range(items Uint32Iterator, handlers ...Uint32Handler) error
- func Uint32SkipUntil(items Uint32Iterator, untilList ...Uint32Checker) error
- func Uint64Discard(items Uint64Iterator) error
- func Uint64Enum(items Uint64Iterator, handlers ...Uint64EnumHandler) error
- func Uint64EnumSkipUntil(items Uint64Iterator, untilList ...Uint64EnumChecker) error
- func Uint64Range(items Uint64Iterator, handlers ...Uint64Handler) error
- func Uint64SkipUntil(items Uint64Iterator, untilList ...Uint64Checker) error
- func Uint8Discard(items Uint8Iterator) error
- func Uint8Enum(items Uint8Iterator, handlers ...Uint8EnumHandler) error
- func Uint8EnumSkipUntil(items Uint8Iterator, untilList ...Uint8EnumChecker) error
- func Uint8Range(items Uint8Iterator, handlers ...Uint8Handler) error
- func Uint8SkipUntil(items Uint8Iterator, untilList ...Uint8Checker) error
- func UintDiscard(items UintIterator) error
- func UintEnum(items UintIterator, handlers ...UintEnumHandler) error
- func UintEnumSkipUntil(items UintIterator, untilList ...UintEnumChecker) error
- func UintRange(items UintIterator, handlers ...UintHandler) error
- func UintSkipUntil(items UintIterator, untilList ...UintChecker) error
- type ByteCheck
- type ByteChecker
- type ByteCompare
- type ByteComparer
- type ByteConvert
- type ByteConverter
- type ByteEnumCheck
- type ByteEnumChecker
- type ByteEnumCompare
- type ByteEnumComparer
- type ByteEnumConvert
- type ByteEnumConverter
- type ByteEnumHandle
- type ByteEnumHandler
- type ByteEnumIterator
- type ByteHandle
- type ByteHandler
- type ByteIterMaker
- type ByteIterator
- func ByteConverting(items ByteIterator, converters ...ByteConverter) ByteIterator
- func ByteDoingUntil(items ByteIterator, untilList ...ByteChecker) ByteIterator
- func ByteEnumConverting(items ByteIterator, converters ...ByteEnumConverter) ByteIterator
- func ByteEnumDoingUntil(items ByteIterator, untilList ...ByteEnumChecker) ByteIterator
- func ByteEnumFiltering(items ByteIterator, filters ...ByteEnumChecker) ByteIterator
- func ByteEnumHandling(items ByteIterator, handlers ...ByteEnumHandler) ByteIterator
- func ByteFiltering(items ByteIterator, filters ...ByteChecker) ByteIterator
- func ByteGettingBatch(items ByteIterator, batchSize int) ByteIterator
- func ByteHandling(items ByteIterator, handlers ...ByteHandler) ByteIterator
- func ByteInvert(items ByteIterator) ByteIterator
- func PriorByteEnumIterator(comparer ByteEnumComparer, itemList ...ByteIterator) ByteIterator
- func PriorByteIterator(comparer ByteComparer, itemList ...ByteIterator) ByteIterator
- func SuperByteIterator(itemList ...ByteIterator) ByteIterator
- type ByteRangeIterator
- type ByteSlice
- type ByteSliceIterator
- type Check
- type Checker
- type Compare
- type Comparer
- type Convert
- type Converter
- type ConvertingByteIterator
- type ConvertingInt16Iterator
- type ConvertingInt32Iterator
- type ConvertingInt64Iterator
- type ConvertingInt8Iterator
- type ConvertingIntIterator
- type ConvertingIterator
- type ConvertingRuneIterator
- type ConvertingStringIterator
- type ConvertingUint16Iterator
- type ConvertingUint32Iterator
- type ConvertingUint64Iterator
- type ConvertingUint8Iterator
- type ConvertingUintIterator
- type DoingUntilByteIterator
- type DoingUntilInt16Iterator
- type DoingUntilInt32Iterator
- type DoingUntilInt64Iterator
- type DoingUntilInt8Iterator
- type DoingUntilIntIterator
- type DoingUntilIterator
- type DoingUntilRuneIterator
- type DoingUntilStringIterator
- type DoingUntilUint16Iterator
- type DoingUntilUint32Iterator
- type DoingUntilUint64Iterator
- type DoingUntilUint8Iterator
- type DoingUntilUintIterator
- type EnumCheck
- type EnumChecker
- type EnumCompare
- type EnumComparer
- type EnumConvert
- type EnumConverter
- type EnumConvertingByteIterator
- type EnumConvertingInt16Iterator
- type EnumConvertingInt32Iterator
- type EnumConvertingInt64Iterator
- type EnumConvertingInt8Iterator
- type EnumConvertingIntIterator
- type EnumConvertingIterator
- type EnumConvertingRuneIterator
- type EnumConvertingStringIterator
- type EnumConvertingUint16Iterator
- type EnumConvertingUint32Iterator
- type EnumConvertingUint64Iterator
- type EnumConvertingUint8Iterator
- type EnumConvertingUintIterator
- type EnumDoingUntilByteIterator
- type EnumDoingUntilInt16Iterator
- type EnumDoingUntilInt32Iterator
- type EnumDoingUntilInt64Iterator
- type EnumDoingUntilInt8Iterator
- type EnumDoingUntilIntIterator
- type EnumDoingUntilIterator
- type EnumDoingUntilRuneIterator
- type EnumDoingUntilStringIterator
- type EnumDoingUntilUint16Iterator
- type EnumDoingUntilUint32Iterator
- type EnumDoingUntilUint64Iterator
- type EnumDoingUntilUint8Iterator
- type EnumDoingUntilUintIterator
- type EnumFilteringByteIterator
- type EnumFilteringInt16Iterator
- type EnumFilteringInt32Iterator
- type EnumFilteringInt64Iterator
- type EnumFilteringInt8Iterator
- type EnumFilteringIntIterator
- type EnumFilteringIterator
- type EnumFilteringRuneIterator
- type EnumFilteringStringIterator
- type EnumFilteringUint16Iterator
- type EnumFilteringUint32Iterator
- type EnumFilteringUint64Iterator
- type EnumFilteringUint8Iterator
- type EnumFilteringUintIterator
- type EnumHandle
- type EnumHandler
- type EnumHandlingByteIterator
- type EnumHandlingInt16Iterator
- type EnumHandlingInt32Iterator
- type EnumHandlingInt64Iterator
- type EnumHandlingInt8Iterator
- type EnumHandlingIntIterator
- type EnumHandlingIterator
- type EnumHandlingRuneIterator
- type EnumHandlingStringIterator
- type EnumHandlingUint16Iterator
- type EnumHandlingUint32Iterator
- type EnumHandlingUint64Iterator
- type EnumHandlingUint8Iterator
- type EnumHandlingUintIterator
- type EnumIterator
- type FilteringByteIterator
- type FilteringInt16Iterator
- type FilteringInt32Iterator
- type FilteringInt64Iterator
- type FilteringInt8Iterator
- type FilteringIntIterator
- type FilteringIterator
- type FilteringRuneIterator
- type FilteringStringIterator
- type FilteringUint16Iterator
- type FilteringUint32Iterator
- type FilteringUint64Iterator
- type FilteringUint8Iterator
- type FilteringUintIterator
- type Handle
- type Handler
- type HandlingByteIterator
- type HandlingInt16Iterator
- type HandlingInt32Iterator
- type HandlingInt64Iterator
- type HandlingInt8Iterator
- type HandlingIntIterator
- type HandlingIterator
- type HandlingRuneIterator
- type HandlingStringIterator
- type HandlingUint16Iterator
- type HandlingUint32Iterator
- type HandlingUint64Iterator
- type HandlingUint8Iterator
- type HandlingUintIterator
- type Int16Check
- type Int16Checker
- type Int16Compare
- type Int16Comparer
- type Int16Convert
- type Int16Converter
- type Int16EnumCheck
- type Int16EnumChecker
- type Int16EnumCompare
- type Int16EnumComparer
- type Int16EnumConvert
- type Int16EnumConverter
- type Int16EnumHandle
- type Int16EnumHandler
- type Int16EnumIterator
- type Int16Handle
- type Int16Handler
- type Int16IterMaker
- type Int16Iterator
- func Int16Converting(items Int16Iterator, converters ...Int16Converter) Int16Iterator
- func Int16DoingUntil(items Int16Iterator, untilList ...Int16Checker) Int16Iterator
- func Int16EnumConverting(items Int16Iterator, converters ...Int16EnumConverter) Int16Iterator
- func Int16EnumDoingUntil(items Int16Iterator, untilList ...Int16EnumChecker) Int16Iterator
- func Int16EnumFiltering(items Int16Iterator, filters ...Int16EnumChecker) Int16Iterator
- func Int16EnumHandling(items Int16Iterator, handlers ...Int16EnumHandler) Int16Iterator
- func Int16Filtering(items Int16Iterator, filters ...Int16Checker) Int16Iterator
- func Int16GettingBatch(items Int16Iterator, batchSize int) Int16Iterator
- func Int16Handling(items Int16Iterator, handlers ...Int16Handler) Int16Iterator
- func Int16Invert(items Int16Iterator) Int16Iterator
- func PriorInt16EnumIterator(comparer Int16EnumComparer, itemList ...Int16Iterator) Int16Iterator
- func PriorInt16Iterator(comparer Int16Comparer, itemList ...Int16Iterator) Int16Iterator
- func SuperInt16Iterator(itemList ...Int16Iterator) Int16Iterator
- type Int16RangeIterator
- type Int16Slice
- type Int16SliceIterator
- type Int32Check
- type Int32Checker
- type Int32Compare
- type Int32Comparer
- type Int32Convert
- type Int32Converter
- type Int32EnumCheck
- type Int32EnumChecker
- type Int32EnumCompare
- type Int32EnumComparer
- type Int32EnumConvert
- type Int32EnumConverter
- type Int32EnumHandle
- type Int32EnumHandler
- type Int32EnumIterator
- type Int32Handle
- type Int32Handler
- type Int32IterMaker
- type Int32Iterator
- func Int32Converting(items Int32Iterator, converters ...Int32Converter) Int32Iterator
- func Int32DoingUntil(items Int32Iterator, untilList ...Int32Checker) Int32Iterator
- func Int32EnumConverting(items Int32Iterator, converters ...Int32EnumConverter) Int32Iterator
- func Int32EnumDoingUntil(items Int32Iterator, untilList ...Int32EnumChecker) Int32Iterator
- func Int32EnumFiltering(items Int32Iterator, filters ...Int32EnumChecker) Int32Iterator
- func Int32EnumHandling(items Int32Iterator, handlers ...Int32EnumHandler) Int32Iterator
- func Int32Filtering(items Int32Iterator, filters ...Int32Checker) Int32Iterator
- func Int32GettingBatch(items Int32Iterator, batchSize int) Int32Iterator
- func Int32Handling(items Int32Iterator, handlers ...Int32Handler) Int32Iterator
- func Int32Invert(items Int32Iterator) Int32Iterator
- func PriorInt32EnumIterator(comparer Int32EnumComparer, itemList ...Int32Iterator) Int32Iterator
- func PriorInt32Iterator(comparer Int32Comparer, itemList ...Int32Iterator) Int32Iterator
- func SuperInt32Iterator(itemList ...Int32Iterator) Int32Iterator
- type Int32RangeIterator
- type Int32Slice
- type Int32SliceIterator
- type Int64Check
- type Int64Checker
- type Int64Compare
- type Int64Comparer
- type Int64Convert
- type Int64Converter
- type Int64EnumCheck
- type Int64EnumChecker
- type Int64EnumCompare
- type Int64EnumComparer
- type Int64EnumConvert
- type Int64EnumConverter
- type Int64EnumHandle
- type Int64EnumHandler
- type Int64EnumIterator
- type Int64Handle
- type Int64Handler
- type Int64IterMaker
- type Int64Iterator
- func Int64Converting(items Int64Iterator, converters ...Int64Converter) Int64Iterator
- func Int64DoingUntil(items Int64Iterator, untilList ...Int64Checker) Int64Iterator
- func Int64EnumConverting(items Int64Iterator, converters ...Int64EnumConverter) Int64Iterator
- func Int64EnumDoingUntil(items Int64Iterator, untilList ...Int64EnumChecker) Int64Iterator
- func Int64EnumFiltering(items Int64Iterator, filters ...Int64EnumChecker) Int64Iterator
- func Int64EnumHandling(items Int64Iterator, handlers ...Int64EnumHandler) Int64Iterator
- func Int64Filtering(items Int64Iterator, filters ...Int64Checker) Int64Iterator
- func Int64GettingBatch(items Int64Iterator, batchSize int) Int64Iterator
- func Int64Handling(items Int64Iterator, handlers ...Int64Handler) Int64Iterator
- func Int64Invert(items Int64Iterator) Int64Iterator
- func PriorInt64EnumIterator(comparer Int64EnumComparer, itemList ...Int64Iterator) Int64Iterator
- func PriorInt64Iterator(comparer Int64Comparer, itemList ...Int64Iterator) Int64Iterator
- func SuperInt64Iterator(itemList ...Int64Iterator) Int64Iterator
- type Int64RangeIterator
- type Int64Slice
- type Int64SliceIterator
- type Int8Check
- type Int8Checker
- type Int8Compare
- type Int8Comparer
- type Int8Convert
- type Int8Converter
- type Int8EnumCheck
- type Int8EnumChecker
- type Int8EnumCompare
- type Int8EnumComparer
- type Int8EnumConvert
- type Int8EnumConverter
- type Int8EnumHandle
- type Int8EnumHandler
- type Int8EnumIterator
- type Int8Handle
- type Int8Handler
- type Int8IterMaker
- type Int8Iterator
- func Int8Converting(items Int8Iterator, converters ...Int8Converter) Int8Iterator
- func Int8DoingUntil(items Int8Iterator, untilList ...Int8Checker) Int8Iterator
- func Int8EnumConverting(items Int8Iterator, converters ...Int8EnumConverter) Int8Iterator
- func Int8EnumDoingUntil(items Int8Iterator, untilList ...Int8EnumChecker) Int8Iterator
- func Int8EnumFiltering(items Int8Iterator, filters ...Int8EnumChecker) Int8Iterator
- func Int8EnumHandling(items Int8Iterator, handlers ...Int8EnumHandler) Int8Iterator
- func Int8Filtering(items Int8Iterator, filters ...Int8Checker) Int8Iterator
- func Int8GettingBatch(items Int8Iterator, batchSize int) Int8Iterator
- func Int8Handling(items Int8Iterator, handlers ...Int8Handler) Int8Iterator
- func Int8Invert(items Int8Iterator) Int8Iterator
- func PriorInt8EnumIterator(comparer Int8EnumComparer, itemList ...Int8Iterator) Int8Iterator
- func PriorInt8Iterator(comparer Int8Comparer, itemList ...Int8Iterator) Int8Iterator
- func SuperInt8Iterator(itemList ...Int8Iterator) Int8Iterator
- type Int8RangeIterator
- type Int8Slice
- type Int8SliceIterator
- type IntCheck
- type IntChecker
- type IntCompare
- type IntComparer
- type IntConvert
- type IntConverter
- type IntEnumCheck
- type IntEnumChecker
- type IntEnumCompare
- type IntEnumComparer
- type IntEnumConvert
- type IntEnumConverter
- type IntEnumHandle
- type IntEnumHandler
- type IntEnumIterator
- type IntHandle
- type IntHandler
- type IntIterMaker
- type IntIterator
- func IntConverting(items IntIterator, converters ...IntConverter) IntIterator
- func IntDoingUntil(items IntIterator, untilList ...IntChecker) IntIterator
- func IntEnumConverting(items IntIterator, converters ...IntEnumConverter) IntIterator
- func IntEnumDoingUntil(items IntIterator, untilList ...IntEnumChecker) IntIterator
- func IntEnumFiltering(items IntIterator, filters ...IntEnumChecker) IntIterator
- func IntEnumHandling(items IntIterator, handlers ...IntEnumHandler) IntIterator
- func IntFiltering(items IntIterator, filters ...IntChecker) IntIterator
- func IntGettingBatch(items IntIterator, batchSize int) IntIterator
- func IntHandling(items IntIterator, handlers ...IntHandler) IntIterator
- func IntInvert(items IntIterator) IntIterator
- func PriorIntEnumIterator(comparer IntEnumComparer, itemList ...IntIterator) IntIterator
- func PriorIntIterator(comparer IntComparer, itemList ...IntIterator) IntIterator
- func SuperIntIterator(itemList ...IntIterator) IntIterator
- type IntRangeIterator
- type IntSlice
- type IntSliceIterator
- type InvertingByteSlice
- type InvertingByteSliceIterator
- type InvertingInt16Slice
- type InvertingInt16SliceIterator
- type InvertingInt32Slice
- type InvertingInt32SliceIterator
- type InvertingInt64Slice
- type InvertingInt64SliceIterator
- type InvertingInt8Slice
- type InvertingInt8SliceIterator
- type InvertingIntSlice
- type InvertingIntSliceIterator
- type InvertingRuneSlice
- type InvertingRuneSliceIterator
- type InvertingSlice
- type InvertingSliceIterator
- type InvertingStringSlice
- type InvertingStringSliceIterator
- type InvertingUint16Slice
- type InvertingUint16SliceIterator
- type InvertingUint32Slice
- type InvertingUint32SliceIterator
- type InvertingUint64Slice
- type InvertingUint64SliceIterator
- type InvertingUint8Slice
- type InvertingUint8SliceIterator
- type InvertingUintSlice
- type InvertingUintSliceIterator
- type IterMaker
- type Iterator
- func Converting(items Iterator, converters ...Converter) Iterator
- func DoingUntil(items Iterator, untilList ...Checker) Iterator
- func EnumConverting(items Iterator, converters ...EnumConverter) Iterator
- func EnumDoingUntil(items Iterator, untilList ...EnumChecker) Iterator
- func EnumFiltering(items Iterator, filters ...EnumChecker) Iterator
- func EnumHandling(items Iterator, handlers ...EnumHandler) Iterator
- func Filtering(items Iterator, filters ...Checker) Iterator
- func GettingBatch(items Iterator, batchSize int) Iterator
- func Handling(items Iterator, handlers ...Handler) Iterator
- func Invert(items Iterator) Iterator
- func PriorEnumIterator(comparer EnumComparer, itemList ...Iterator) Iterator
- func PriorIterator(comparer Comparer, itemList ...Iterator) Iterator
- func SuperIterator(itemList ...Iterator) Iterator
- type MakeByteIter
- type MakeInt16Iter
- type MakeInt32Iter
- type MakeInt64Iter
- type MakeInt8Iter
- type MakeIntIter
- type MakeIter
- type MakeRuneIter
- type MakeStringIter
- type MakeUint16Iter
- type MakeUint32Iter
- type MakeUint64Iter
- type MakeUint8Iter
- type MakeUintIter
- type RangeIterator
- type RuneCheck
- type RuneChecker
- type RuneCompare
- type RuneComparer
- type RuneConvert
- type RuneConverter
- type RuneEnumCheck
- type RuneEnumChecker
- type RuneEnumCompare
- type RuneEnumComparer
- type RuneEnumConvert
- type RuneEnumConverter
- type RuneEnumHandle
- type RuneEnumHandler
- type RuneEnumIterator
- type RuneHandle
- type RuneHandler
- type RuneIterMaker
- type RuneIterator
- func PriorRuneEnumIterator(comparer RuneEnumComparer, itemList ...RuneIterator) RuneIterator
- func PriorRuneIterator(comparer RuneComparer, itemList ...RuneIterator) RuneIterator
- func RuneConverting(items RuneIterator, converters ...RuneConverter) RuneIterator
- func RuneDoingUntil(items RuneIterator, untilList ...RuneChecker) RuneIterator
- func RuneEnumConverting(items RuneIterator, converters ...RuneEnumConverter) RuneIterator
- func RuneEnumDoingUntil(items RuneIterator, untilList ...RuneEnumChecker) RuneIterator
- func RuneEnumFiltering(items RuneIterator, filters ...RuneEnumChecker) RuneIterator
- func RuneEnumHandling(items RuneIterator, handlers ...RuneEnumHandler) RuneIterator
- func RuneFiltering(items RuneIterator, filters ...RuneChecker) RuneIterator
- func RuneGettingBatch(items RuneIterator, batchSize int) RuneIterator
- func RuneHandling(items RuneIterator, handlers ...RuneHandler) RuneIterator
- func RuneInvert(items RuneIterator) RuneIterator
- func SuperRuneIterator(itemList ...RuneIterator) RuneIterator
- type RuneRangeIterator
- type RuneSlice
- type RuneSliceIterator
- type Slice
- type SliceIterator
- type StringCheck
- type StringChecker
- type StringCompare
- type StringComparer
- type StringConvert
- type StringConverter
- type StringEnumCheck
- type StringEnumChecker
- type StringEnumCompare
- type StringEnumComparer
- type StringEnumConvert
- type StringEnumConverter
- type StringEnumHandle
- type StringEnumHandler
- type StringEnumIterator
- type StringHandle
- type StringHandler
- type StringIterMaker
- type StringIterator
- func PriorStringEnumIterator(comparer StringEnumComparer, itemList ...StringIterator) StringIterator
- func PriorStringIterator(comparer StringComparer, itemList ...StringIterator) StringIterator
- func StringConverting(items StringIterator, converters ...StringConverter) StringIterator
- func StringDoingUntil(items StringIterator, untilList ...StringChecker) StringIterator
- func StringEnumConverting(items StringIterator, converters ...StringEnumConverter) StringIterator
- func StringEnumDoingUntil(items StringIterator, untilList ...StringEnumChecker) StringIterator
- func StringEnumFiltering(items StringIterator, filters ...StringEnumChecker) StringIterator
- func StringEnumHandling(items StringIterator, handlers ...StringEnumHandler) StringIterator
- func StringFiltering(items StringIterator, filters ...StringChecker) StringIterator
- func StringGettingBatch(items StringIterator, batchSize int) StringIterator
- func StringHandling(items StringIterator, handlers ...StringHandler) StringIterator
- func StringInvert(items StringIterator) StringIterator
- func SuperStringIterator(itemList ...StringIterator) StringIterator
- type StringRangeIterator
- type StringSlice
- type StringSliceIterator
- type Uint16Check
- type Uint16Checker
- type Uint16Compare
- type Uint16Comparer
- type Uint16Convert
- type Uint16Converter
- type Uint16EnumCheck
- type Uint16EnumChecker
- type Uint16EnumCompare
- type Uint16EnumComparer
- type Uint16EnumConvert
- type Uint16EnumConverter
- type Uint16EnumHandle
- type Uint16EnumHandler
- type Uint16EnumIterator
- type Uint16Handle
- type Uint16Handler
- type Uint16IterMaker
- type Uint16Iterator
- func PriorUint16EnumIterator(comparer Uint16EnumComparer, itemList ...Uint16Iterator) Uint16Iterator
- func PriorUint16Iterator(comparer Uint16Comparer, itemList ...Uint16Iterator) Uint16Iterator
- func SuperUint16Iterator(itemList ...Uint16Iterator) Uint16Iterator
- func Uint16Converting(items Uint16Iterator, converters ...Uint16Converter) Uint16Iterator
- func Uint16DoingUntil(items Uint16Iterator, untilList ...Uint16Checker) Uint16Iterator
- func Uint16EnumConverting(items Uint16Iterator, converters ...Uint16EnumConverter) Uint16Iterator
- func Uint16EnumDoingUntil(items Uint16Iterator, untilList ...Uint16EnumChecker) Uint16Iterator
- func Uint16EnumFiltering(items Uint16Iterator, filters ...Uint16EnumChecker) Uint16Iterator
- func Uint16EnumHandling(items Uint16Iterator, handlers ...Uint16EnumHandler) Uint16Iterator
- func Uint16Filtering(items Uint16Iterator, filters ...Uint16Checker) Uint16Iterator
- func Uint16GettingBatch(items Uint16Iterator, batchSize int) Uint16Iterator
- func Uint16Handling(items Uint16Iterator, handlers ...Uint16Handler) Uint16Iterator
- func Uint16Invert(items Uint16Iterator) Uint16Iterator
- type Uint16RangeIterator
- type Uint16Slice
- type Uint16SliceIterator
- type Uint32Check
- type Uint32Checker
- type Uint32Compare
- type Uint32Comparer
- type Uint32Convert
- type Uint32Converter
- type Uint32EnumCheck
- type Uint32EnumChecker
- type Uint32EnumCompare
- type Uint32EnumComparer
- type Uint32EnumConvert
- type Uint32EnumConverter
- type Uint32EnumHandle
- type Uint32EnumHandler
- type Uint32EnumIterator
- type Uint32Handle
- type Uint32Handler
- type Uint32IterMaker
- type Uint32Iterator
- func PriorUint32EnumIterator(comparer Uint32EnumComparer, itemList ...Uint32Iterator) Uint32Iterator
- func PriorUint32Iterator(comparer Uint32Comparer, itemList ...Uint32Iterator) Uint32Iterator
- func SuperUint32Iterator(itemList ...Uint32Iterator) Uint32Iterator
- func Uint32Converting(items Uint32Iterator, converters ...Uint32Converter) Uint32Iterator
- func Uint32DoingUntil(items Uint32Iterator, untilList ...Uint32Checker) Uint32Iterator
- func Uint32EnumConverting(items Uint32Iterator, converters ...Uint32EnumConverter) Uint32Iterator
- func Uint32EnumDoingUntil(items Uint32Iterator, untilList ...Uint32EnumChecker) Uint32Iterator
- func Uint32EnumFiltering(items Uint32Iterator, filters ...Uint32EnumChecker) Uint32Iterator
- func Uint32EnumHandling(items Uint32Iterator, handlers ...Uint32EnumHandler) Uint32Iterator
- func Uint32Filtering(items Uint32Iterator, filters ...Uint32Checker) Uint32Iterator
- func Uint32GettingBatch(items Uint32Iterator, batchSize int) Uint32Iterator
- func Uint32Handling(items Uint32Iterator, handlers ...Uint32Handler) Uint32Iterator
- func Uint32Invert(items Uint32Iterator) Uint32Iterator
- type Uint32RangeIterator
- type Uint32Slice
- type Uint32SliceIterator
- type Uint64Check
- type Uint64Checker
- type Uint64Compare
- type Uint64Comparer
- type Uint64Convert
- type Uint64Converter
- type Uint64EnumCheck
- type Uint64EnumChecker
- type Uint64EnumCompare
- type Uint64EnumComparer
- type Uint64EnumConvert
- type Uint64EnumConverter
- type Uint64EnumHandle
- type Uint64EnumHandler
- type Uint64EnumIterator
- type Uint64Handle
- type Uint64Handler
- type Uint64IterMaker
- type Uint64Iterator
- func PriorUint64EnumIterator(comparer Uint64EnumComparer, itemList ...Uint64Iterator) Uint64Iterator
- func PriorUint64Iterator(comparer Uint64Comparer, itemList ...Uint64Iterator) Uint64Iterator
- func SuperUint64Iterator(itemList ...Uint64Iterator) Uint64Iterator
- func Uint64Converting(items Uint64Iterator, converters ...Uint64Converter) Uint64Iterator
- func Uint64DoingUntil(items Uint64Iterator, untilList ...Uint64Checker) Uint64Iterator
- func Uint64EnumConverting(items Uint64Iterator, converters ...Uint64EnumConverter) Uint64Iterator
- func Uint64EnumDoingUntil(items Uint64Iterator, untilList ...Uint64EnumChecker) Uint64Iterator
- func Uint64EnumFiltering(items Uint64Iterator, filters ...Uint64EnumChecker) Uint64Iterator
- func Uint64EnumHandling(items Uint64Iterator, handlers ...Uint64EnumHandler) Uint64Iterator
- func Uint64Filtering(items Uint64Iterator, filters ...Uint64Checker) Uint64Iterator
- func Uint64GettingBatch(items Uint64Iterator, batchSize int) Uint64Iterator
- func Uint64Handling(items Uint64Iterator, handlers ...Uint64Handler) Uint64Iterator
- func Uint64Invert(items Uint64Iterator) Uint64Iterator
- type Uint64RangeIterator
- type Uint64Slice
- type Uint64SliceIterator
- type Uint8Check
- type Uint8Checker
- type Uint8Compare
- type Uint8Comparer
- type Uint8Convert
- type Uint8Converter
- type Uint8EnumCheck
- type Uint8EnumChecker
- type Uint8EnumCompare
- type Uint8EnumComparer
- type Uint8EnumConvert
- type Uint8EnumConverter
- type Uint8EnumHandle
- type Uint8EnumHandler
- type Uint8EnumIterator
- type Uint8Handle
- type Uint8Handler
- type Uint8IterMaker
- type Uint8Iterator
- func PriorUint8EnumIterator(comparer Uint8EnumComparer, itemList ...Uint8Iterator) Uint8Iterator
- func PriorUint8Iterator(comparer Uint8Comparer, itemList ...Uint8Iterator) Uint8Iterator
- func SuperUint8Iterator(itemList ...Uint8Iterator) Uint8Iterator
- func Uint8Converting(items Uint8Iterator, converters ...Uint8Converter) Uint8Iterator
- func Uint8DoingUntil(items Uint8Iterator, untilList ...Uint8Checker) Uint8Iterator
- func Uint8EnumConverting(items Uint8Iterator, converters ...Uint8EnumConverter) Uint8Iterator
- func Uint8EnumDoingUntil(items Uint8Iterator, untilList ...Uint8EnumChecker) Uint8Iterator
- func Uint8EnumFiltering(items Uint8Iterator, filters ...Uint8EnumChecker) Uint8Iterator
- func Uint8EnumHandling(items Uint8Iterator, handlers ...Uint8EnumHandler) Uint8Iterator
- func Uint8Filtering(items Uint8Iterator, filters ...Uint8Checker) Uint8Iterator
- func Uint8GettingBatch(items Uint8Iterator, batchSize int) Uint8Iterator
- func Uint8Handling(items Uint8Iterator, handlers ...Uint8Handler) Uint8Iterator
- func Uint8Invert(items Uint8Iterator) Uint8Iterator
- type Uint8RangeIterator
- type Uint8Slice
- type Uint8SliceIterator
- type UintCheck
- type UintChecker
- type UintCompare
- type UintComparer
- type UintConvert
- type UintConverter
- type UintEnumCheck
- type UintEnumChecker
- type UintEnumCompare
- type UintEnumComparer
- type UintEnumConvert
- type UintEnumConverter
- type UintEnumHandle
- type UintEnumHandler
- type UintEnumIterator
- type UintHandle
- type UintHandler
- type UintIterMaker
- type UintIterator
- func PriorUintEnumIterator(comparer UintEnumComparer, itemList ...UintIterator) UintIterator
- func PriorUintIterator(comparer UintComparer, itemList ...UintIterator) UintIterator
- func SuperUintIterator(itemList ...UintIterator) UintIterator
- func UintConverting(items UintIterator, converters ...UintConverter) UintIterator
- func UintDoingUntil(items UintIterator, untilList ...UintChecker) UintIterator
- func UintEnumConverting(items UintIterator, converters ...UintEnumConverter) UintIterator
- func UintEnumDoingUntil(items UintIterator, untilList ...UintEnumChecker) UintIterator
- func UintEnumFiltering(items UintIterator, filters ...UintEnumChecker) UintIterator
- func UintEnumHandling(items UintIterator, handlers ...UintEnumHandler) UintIterator
- func UintFiltering(items UintIterator, filters ...UintChecker) UintIterator
- func UintGettingBatch(items UintIterator, batchSize int) UintIterator
- func UintHandling(items UintIterator, handlers ...UintHandler) UintIterator
- func UintInvert(items UintIterator) UintIterator
- type UintRangeIterator
- type UintSlice
- type UintSliceIterator
Constants ¶
This section is empty.
Variables ¶
var ( // AlwaysByteEnumCheckTrue always returns true and empty error. AlwaysByteEnumCheckTrue = EnumFromByteChecker( AlwaysByteCheckTrue) // AlwaysByteEnumCheckFalse always returns false and empty error. AlwaysByteEnumCheckFalse = EnumFromByteChecker( AlwaysByteCheckFalse) )
var ( // AlwaysInt16EnumCheckTrue always returns true and empty error. AlwaysInt16EnumCheckTrue = EnumFromInt16Checker( AlwaysInt16CheckTrue) // AlwaysInt16EnumCheckFalse always returns false and empty error. AlwaysInt16EnumCheckFalse = EnumFromInt16Checker( AlwaysInt16CheckFalse) )
var ( // AlwaysInt32EnumCheckTrue always returns true and empty error. AlwaysInt32EnumCheckTrue = EnumFromInt32Checker( AlwaysInt32CheckTrue) // AlwaysInt32EnumCheckFalse always returns false and empty error. AlwaysInt32EnumCheckFalse = EnumFromInt32Checker( AlwaysInt32CheckFalse) )
var ( // AlwaysInt64EnumCheckTrue always returns true and empty error. AlwaysInt64EnumCheckTrue = EnumFromInt64Checker( AlwaysInt64CheckTrue) // AlwaysInt64EnumCheckFalse always returns false and empty error. AlwaysInt64EnumCheckFalse = EnumFromInt64Checker( AlwaysInt64CheckFalse) )
var ( // AlwaysInt8EnumCheckTrue always returns true and empty error. AlwaysInt8EnumCheckTrue = EnumFromInt8Checker( AlwaysInt8CheckTrue) // AlwaysInt8EnumCheckFalse always returns false and empty error. AlwaysInt8EnumCheckFalse = EnumFromInt8Checker( AlwaysInt8CheckFalse) )
var ( // AlwaysIntEnumCheckTrue always returns true and empty error. AlwaysIntEnumCheckTrue = EnumFromIntChecker( AlwaysIntCheckTrue) // AlwaysIntEnumCheckFalse always returns false and empty error. AlwaysIntEnumCheckFalse = EnumFromIntChecker( AlwaysIntCheckFalse) )
var ( // AlwaysEnumCheckTrue always returns true and empty error. AlwaysEnumCheckTrue = EnumFromChecker( AlwaysCheckTrue) // AlwaysEnumCheckFalse always returns false and empty error. AlwaysEnumCheckFalse = EnumFromChecker( AlwaysCheckFalse) )
var ( // AlwaysRuneEnumCheckTrue always returns true and empty error. AlwaysRuneEnumCheckTrue = EnumFromRuneChecker( AlwaysRuneCheckTrue) // AlwaysRuneEnumCheckFalse always returns false and empty error. AlwaysRuneEnumCheckFalse = EnumFromRuneChecker( AlwaysRuneCheckFalse) )
var ( // AlwaysStringEnumCheckTrue always returns true and empty error. AlwaysStringEnumCheckTrue = EnumFromStringChecker( AlwaysStringCheckTrue) // AlwaysStringEnumCheckFalse always returns false and empty error. AlwaysStringEnumCheckFalse = EnumFromStringChecker( AlwaysStringCheckFalse) )
var ( // AlwaysUint16EnumCheckTrue always returns true and empty error. AlwaysUint16EnumCheckTrue = EnumFromUint16Checker( AlwaysUint16CheckTrue) // AlwaysUint16EnumCheckFalse always returns false and empty error. AlwaysUint16EnumCheckFalse = EnumFromUint16Checker( AlwaysUint16CheckFalse) )
var ( // AlwaysUint32EnumCheckTrue always returns true and empty error. AlwaysUint32EnumCheckTrue = EnumFromUint32Checker( AlwaysUint32CheckTrue) // AlwaysUint32EnumCheckFalse always returns false and empty error. AlwaysUint32EnumCheckFalse = EnumFromUint32Checker( AlwaysUint32CheckFalse) )
var ( // AlwaysUint64EnumCheckTrue always returns true and empty error. AlwaysUint64EnumCheckTrue = EnumFromUint64Checker( AlwaysUint64CheckTrue) // AlwaysUint64EnumCheckFalse always returns false and empty error. AlwaysUint64EnumCheckFalse = EnumFromUint64Checker( AlwaysUint64CheckFalse) )
var ( // AlwaysUint8EnumCheckTrue always returns true and empty error. AlwaysUint8EnumCheckTrue = EnumFromUint8Checker( AlwaysUint8CheckTrue) // AlwaysUint8EnumCheckFalse always returns false and empty error. AlwaysUint8EnumCheckFalse = EnumFromUint8Checker( AlwaysUint8CheckFalse) )
var ( // AlwaysUintEnumCheckTrue always returns true and empty error. AlwaysUintEnumCheckTrue = EnumFromUintChecker( AlwaysUintCheckTrue) // AlwaysUintEnumCheckFalse always returns false and empty error. AlwaysUintEnumCheckFalse = EnumFromUintChecker( AlwaysUintCheckFalse) )
var ByteDoEnumNothing = ByteEnumHandle(func(_ int, _ byte) error { return nil })
ByteDoEnumNothing does nothing.
var DoEnumNothing = EnumHandle(func(_ int, _ interface{}) error { return nil })
DoEnumNothing does nothing.
var EndOfByteIterator = errors.New("end of byte iterator")
EndOfByteIterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfInt16Iterator = errors.New("end of int16 iterator")
EndOfInt16Iterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfInt32Iterator = errors.New("end of int32 iterator")
EndOfInt32Iterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfInt64Iterator = errors.New("end of int64 iterator")
EndOfInt64Iterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfInt8Iterator = errors.New("end of int8 iterator")
EndOfInt8Iterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfIntIterator = errors.New("end of int iterator")
EndOfIntIterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfIterator = errors.New("end of interface{} iterator")
EndOfIterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfRuneIterator = errors.New("end of rune iterator")
EndOfRuneIterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfStringIterator = errors.New("end of string iterator")
EndOfStringIterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfUint16Iterator = errors.New("end of uint16 iterator")
EndOfUint16Iterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfUint32Iterator = errors.New("end of uint32 iterator")
EndOfUint32Iterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfUint64Iterator = errors.New("end of uint64 iterator")
EndOfUint64Iterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfUint8Iterator = errors.New("end of uint8 iterator")
EndOfUint8Iterator is an error to stop iterating over an iterator. It is used in some method of the package.
var EndOfUintIterator = errors.New("end of uint iterator")
EndOfUintIterator is an error to stop iterating over an iterator. It is used in some method of the package.
var Int16DoEnumNothing = Int16EnumHandle(func(_ int, _ int16) error { return nil })
Int16DoEnumNothing does nothing.
var Int32DoEnumNothing = Int32EnumHandle(func(_ int, _ int32) error { return nil })
Int32DoEnumNothing does nothing.
var Int64DoEnumNothing = Int64EnumHandle(func(_ int, _ int64) error { return nil })
Int64DoEnumNothing does nothing.
var Int8DoEnumNothing = Int8EnumHandle(func(_ int, _ int8) error { return nil })
Int8DoEnumNothing does nothing.
var IntDoEnumNothing = IntEnumHandle(func(_ int, _ int) error { return nil })
IntDoEnumNothing does nothing.
var RuneDoEnumNothing = RuneEnumHandle(func(_ int, _ rune) error { return nil })
RuneDoEnumNothing does nothing.
var StringDoEnumNothing = StringEnumHandle(func(_ int, _ string) error { return nil })
StringDoEnumNothing does nothing.
var Uint16DoEnumNothing = Uint16EnumHandle(func(_ int, _ uint16) error { return nil })
Uint16DoEnumNothing does nothing.
var Uint32DoEnumNothing = Uint32EnumHandle(func(_ int, _ uint32) error { return nil })
Uint32DoEnumNothing does nothing.
var Uint64DoEnumNothing = Uint64EnumHandle(func(_ int, _ uint64) error { return nil })
Uint64DoEnumNothing does nothing.
var Uint8DoEnumNothing = Uint8EnumHandle(func(_ int, _ uint8) error { return nil })
Uint8DoEnumNothing does nothing.
var UintDoEnumNothing = UintEnumHandle(func(_ int, _ uint) error { return nil })
UintDoEnumNothing does nothing.
Functions ¶
func ByteDiscard ¶
func ByteDiscard(items ByteIterator) error
ByteDiscard just range over all items and do nothing with each of them.
func ByteEnum ¶
func ByteEnum(items ByteIterator, handlers ...ByteEnumHandler) error
ByteEnum iterates over items and their ordering numbers and use handlers to each one.
func ByteEnumSkipUntil ¶
func ByteEnumSkipUntil(items ByteIterator, untilList ...ByteEnumChecker) error
ByteEnumSkipUntil sets until conditions to skip few items.
func ByteRange ¶
func ByteRange(items ByteIterator, handlers ...ByteHandler) error
ByteRange iterates over items and use handlers to each one.
func ByteSkipUntil ¶
func ByteSkipUntil(items ByteIterator, untilList ...ByteChecker) error
ByteSkipUntil sets until conditions to skip few items.
func Enum ¶
func Enum(items Iterator, handlers ...EnumHandler) error
Enum iterates over items and their ordering numbers and use handlers to each one.
func EnumSkipUntil ¶
func EnumSkipUntil(items Iterator, untilList ...EnumChecker) error
EnumSkipUntil sets until conditions to skip few items.
func Int16Discard ¶
func Int16Discard(items Int16Iterator) error
Int16Discard just range over all items and do nothing with each of them.
func Int16Enum ¶
func Int16Enum(items Int16Iterator, handlers ...Int16EnumHandler) error
Int16Enum iterates over items and their ordering numbers and use handlers to each one.
func Int16EnumSkipUntil ¶
func Int16EnumSkipUntil(items Int16Iterator, untilList ...Int16EnumChecker) error
Int16EnumSkipUntil sets until conditions to skip few items.
func Int16Range ¶
func Int16Range(items Int16Iterator, handlers ...Int16Handler) error
Int16Range iterates over items and use handlers to each one.
func Int16SkipUntil ¶
func Int16SkipUntil(items Int16Iterator, untilList ...Int16Checker) error
Int16SkipUntil sets until conditions to skip few items.
func Int32Discard ¶
func Int32Discard(items Int32Iterator) error
Int32Discard just range over all items and do nothing with each of them.
func Int32Enum ¶
func Int32Enum(items Int32Iterator, handlers ...Int32EnumHandler) error
Int32Enum iterates over items and their ordering numbers and use handlers to each one.
func Int32EnumSkipUntil ¶
func Int32EnumSkipUntil(items Int32Iterator, untilList ...Int32EnumChecker) error
Int32EnumSkipUntil sets until conditions to skip few items.
func Int32Range ¶
func Int32Range(items Int32Iterator, handlers ...Int32Handler) error
Int32Range iterates over items and use handlers to each one.
func Int32SkipUntil ¶
func Int32SkipUntil(items Int32Iterator, untilList ...Int32Checker) error
Int32SkipUntil sets until conditions to skip few items.
func Int64Discard ¶
func Int64Discard(items Int64Iterator) error
Int64Discard just range over all items and do nothing with each of them.
func Int64Enum ¶
func Int64Enum(items Int64Iterator, handlers ...Int64EnumHandler) error
Int64Enum iterates over items and their ordering numbers and use handlers to each one.
func Int64EnumSkipUntil ¶
func Int64EnumSkipUntil(items Int64Iterator, untilList ...Int64EnumChecker) error
Int64EnumSkipUntil sets until conditions to skip few items.
func Int64Range ¶
func Int64Range(items Int64Iterator, handlers ...Int64Handler) error
Int64Range iterates over items and use handlers to each one.
func Int64SkipUntil ¶
func Int64SkipUntil(items Int64Iterator, untilList ...Int64Checker) error
Int64SkipUntil sets until conditions to skip few items.
func Int8Discard ¶
func Int8Discard(items Int8Iterator) error
Int8Discard just range over all items and do nothing with each of them.
func Int8Enum ¶
func Int8Enum(items Int8Iterator, handlers ...Int8EnumHandler) error
Int8Enum iterates over items and their ordering numbers and use handlers to each one.
func Int8EnumSkipUntil ¶
func Int8EnumSkipUntil(items Int8Iterator, untilList ...Int8EnumChecker) error
Int8EnumSkipUntil sets until conditions to skip few items.
func Int8Range ¶
func Int8Range(items Int8Iterator, handlers ...Int8Handler) error
Int8Range iterates over items and use handlers to each one.
func Int8SkipUntil ¶
func Int8SkipUntil(items Int8Iterator, untilList ...Int8Checker) error
Int8SkipUntil sets until conditions to skip few items.
func IntDiscard ¶
func IntDiscard(items IntIterator) error
IntDiscard just range over all items and do nothing with each of them.
func IntEnum ¶
func IntEnum(items IntIterator, handlers ...IntEnumHandler) error
IntEnum iterates over items and their ordering numbers and use handlers to each one.
func IntEnumSkipUntil ¶
func IntEnumSkipUntil(items IntIterator, untilList ...IntEnumChecker) error
IntEnumSkipUntil sets until conditions to skip few items.
func IntRange ¶
func IntRange(items IntIterator, handlers ...IntHandler) error
IntRange iterates over items and use handlers to each one.
func IntSkipUntil ¶
func IntSkipUntil(items IntIterator, untilList ...IntChecker) error
IntSkipUntil sets until conditions to skip few items.
func RuneDiscard ¶
func RuneDiscard(items RuneIterator) error
RuneDiscard just range over all items and do nothing with each of them.
func RuneEnum ¶
func RuneEnum(items RuneIterator, handlers ...RuneEnumHandler) error
RuneEnum iterates over items and their ordering numbers and use handlers to each one.
func RuneEnumSkipUntil ¶
func RuneEnumSkipUntil(items RuneIterator, untilList ...RuneEnumChecker) error
RuneEnumSkipUntil sets until conditions to skip few items.
func RuneRange ¶
func RuneRange(items RuneIterator, handlers ...RuneHandler) error
RuneRange iterates over items and use handlers to each one.
func RuneSkipUntil ¶
func RuneSkipUntil(items RuneIterator, untilList ...RuneChecker) error
RuneSkipUntil sets until conditions to skip few items.
func StringDiscard ¶
func StringDiscard(items StringIterator) error
StringDiscard just range over all items and do nothing with each of them.
func StringEnum ¶
func StringEnum(items StringIterator, handlers ...StringEnumHandler) error
StringEnum iterates over items and their ordering numbers and use handlers to each one.
func StringEnumSkipUntil ¶
func StringEnumSkipUntil(items StringIterator, untilList ...StringEnumChecker) error
StringEnumSkipUntil sets until conditions to skip few items.
func StringRange ¶
func StringRange(items StringIterator, handlers ...StringHandler) error
StringRange iterates over items and use handlers to each one.
func StringSkipUntil ¶
func StringSkipUntil(items StringIterator, untilList ...StringChecker) error
StringSkipUntil sets until conditions to skip few items.
func Uint16Discard ¶
func Uint16Discard(items Uint16Iterator) error
Uint16Discard just range over all items and do nothing with each of them.
func Uint16Enum ¶
func Uint16Enum(items Uint16Iterator, handlers ...Uint16EnumHandler) error
Uint16Enum iterates over items and their ordering numbers and use handlers to each one.
func Uint16EnumSkipUntil ¶
func Uint16EnumSkipUntil(items Uint16Iterator, untilList ...Uint16EnumChecker) error
Uint16EnumSkipUntil sets until conditions to skip few items.
func Uint16Range ¶
func Uint16Range(items Uint16Iterator, handlers ...Uint16Handler) error
Uint16Range iterates over items and use handlers to each one.
func Uint16SkipUntil ¶
func Uint16SkipUntil(items Uint16Iterator, untilList ...Uint16Checker) error
Uint16SkipUntil sets until conditions to skip few items.
func Uint32Discard ¶
func Uint32Discard(items Uint32Iterator) error
Uint32Discard just range over all items and do nothing with each of them.
func Uint32Enum ¶
func Uint32Enum(items Uint32Iterator, handlers ...Uint32EnumHandler) error
Uint32Enum iterates over items and their ordering numbers and use handlers to each one.
func Uint32EnumSkipUntil ¶
func Uint32EnumSkipUntil(items Uint32Iterator, untilList ...Uint32EnumChecker) error
Uint32EnumSkipUntil sets until conditions to skip few items.
func Uint32Range ¶
func Uint32Range(items Uint32Iterator, handlers ...Uint32Handler) error
Uint32Range iterates over items and use handlers to each one.
func Uint32SkipUntil ¶
func Uint32SkipUntil(items Uint32Iterator, untilList ...Uint32Checker) error
Uint32SkipUntil sets until conditions to skip few items.
func Uint64Discard ¶
func Uint64Discard(items Uint64Iterator) error
Uint64Discard just range over all items and do nothing with each of them.
func Uint64Enum ¶
func Uint64Enum(items Uint64Iterator, handlers ...Uint64EnumHandler) error
Uint64Enum iterates over items and their ordering numbers and use handlers to each one.
func Uint64EnumSkipUntil ¶
func Uint64EnumSkipUntil(items Uint64Iterator, untilList ...Uint64EnumChecker) error
Uint64EnumSkipUntil sets until conditions to skip few items.
func Uint64Range ¶
func Uint64Range(items Uint64Iterator, handlers ...Uint64Handler) error
Uint64Range iterates over items and use handlers to each one.
func Uint64SkipUntil ¶
func Uint64SkipUntil(items Uint64Iterator, untilList ...Uint64Checker) error
Uint64SkipUntil sets until conditions to skip few items.
func Uint8Discard ¶
func Uint8Discard(items Uint8Iterator) error
Uint8Discard just range over all items and do nothing with each of them.
func Uint8Enum ¶
func Uint8Enum(items Uint8Iterator, handlers ...Uint8EnumHandler) error
Uint8Enum iterates over items and their ordering numbers and use handlers to each one.
func Uint8EnumSkipUntil ¶
func Uint8EnumSkipUntil(items Uint8Iterator, untilList ...Uint8EnumChecker) error
Uint8EnumSkipUntil sets until conditions to skip few items.
func Uint8Range ¶
func Uint8Range(items Uint8Iterator, handlers ...Uint8Handler) error
Uint8Range iterates over items and use handlers to each one.
func Uint8SkipUntil ¶
func Uint8SkipUntil(items Uint8Iterator, untilList ...Uint8Checker) error
Uint8SkipUntil sets until conditions to skip few items.
func UintDiscard ¶
func UintDiscard(items UintIterator) error
UintDiscard just range over all items and do nothing with each of them.
func UintEnum ¶
func UintEnum(items UintIterator, handlers ...UintEnumHandler) error
UintEnum iterates over items and their ordering numbers and use handlers to each one.
func UintEnumSkipUntil ¶
func UintEnumSkipUntil(items UintIterator, untilList ...UintEnumChecker) error
UintEnumSkipUntil sets until conditions to skip few items.
func UintRange ¶
func UintRange(items UintIterator, handlers ...UintHandler) error
UintRange iterates over items and use handlers to each one.
func UintSkipUntil ¶
func UintSkipUntil(items UintIterator, untilList ...UintChecker) error
UintSkipUntil sets until conditions to skip few items.
Types ¶
type ByteChecker ¶
type ByteChecker interface { // Check should check an item type of byte for some condition. // It is suggested to return EndOfByteIterator to stop iteration. Check(byte) (bool, error) }
ByteChecker is an object checking an item type of byte for some condition.
var ( // AlwaysByteCheckTrue always returns true and empty error. AlwaysByteCheckTrue ByteChecker = ByteCheck( func(item byte) (bool, error) { return true, nil }) // AlwaysByteCheckFalse always returns false and empty error. AlwaysByteCheckFalse ByteChecker = ByteCheck( func(item byte) (bool, error) { return false, nil }) )
func AllByte ¶
func AllByte(checkers ...ByteChecker) ByteChecker
AllByte combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyByte ¶
func AnyByte(checkers ...ByteChecker) ByteChecker
AnyByte combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotByte ¶
func NotByte(checker ByteChecker) ByteChecker
NotByte do an inversion for checker result. It is returns AlwaysByteCheckTrue if checker is nil.
type ByteCompare ¶ added in v0.0.2
ByteCompare is a shortcut implementation of ByteEnumComparer based on a function.
func (ByteCompare) IsLess ¶ added in v0.0.2
func (c ByteCompare) IsLess(lhs, rhs byte) bool
IsLess is true if lhs is less than rhs.
type ByteComparer ¶ added in v0.0.2
type ByteComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs byte) bool }
ByteEnumComparer is a strategy to compare two types.
var ByteAlwaysLess ByteComparer = ByteCompare(func(_, _ byte) bool { return true })
EnumByteAlwaysLess is an implementation of ByteEnumComparer returning always true.
type ByteConvert ¶
ByteConvert is a shortcut implementation of ByteConverter based on a function.
type ByteConverter ¶
type ByteConverter interface { // Convert should convert an item type of byte into another item of byte. // It is suggested to return EndOfByteIterator to stop iteration. Convert(byte) (byte, error) }
ByteConverter is an object converting an item type of byte.
var NoByteConvert ByteConverter = ByteConvert( func(item byte) (byte, error) { return item, nil })
NoByteConvert does nothing with item, just returns it as is.
func ByteConverterSeries ¶
func ByteConverterSeries(converters ...ByteConverter) ByteConverter
ByteConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type ByteEnumCheck ¶
ByteEnumCheck is a shortcut implementation of ByteEnumChecker based on a function.
type ByteEnumChecker ¶
type ByteEnumChecker interface { // Check checks an item type of byte and its ordering number for some condition. // It is suggested to return EndOfByteIterator to stop iteration. Check(int, byte) (bool, error) }
ByteEnumChecker is an object checking an item type of byte and its ordering number in for some condition.
func EnumAllByte ¶
func EnumAllByte(checkers ...ByteEnumChecker) ByteEnumChecker
EnumAllByte combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyByte ¶
func EnumAnyByte(checkers ...ByteEnumChecker) ByteEnumChecker
EnumAnyByte combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromByteChecker ¶
func EnumFromByteChecker(checker ByteChecker) ByteEnumChecker
EnumFromByteChecker adapts checker type of ByteChecker to the interface ByteEnumChecker. If checker is nil it is return based on AlwaysByteCheckFalse enum checker.
func EnumNotByte ¶
func EnumNotByte(checker ByteEnumChecker) ByteEnumChecker
EnumNotByte do an inversion for checker result. It is returns AlwaysByteEnumCheckTrue if checker is nil.
type ByteEnumCompare ¶ added in v0.0.4
ByteEnumCompare is a shortcut implementation of ByteEnumComparer based on a function.
type ByteEnumComparer ¶ added in v0.0.4
type ByteEnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs byte, nRHS int, rhs byte) bool }
ByteEnumComparer is a strategy to compare two types and their order numbers.
var EnumByteAlwaysLess ByteEnumComparer = ByteEnumCompare( func(_ int, _ byte, _ int, _ byte) bool { return true })
EnumByteAlwaysLess is an implementation of ByteEnumComparer returning always true.
type ByteEnumConvert ¶
ByteEnumConvert is a shortcut implementation of ByteEnumConverter based on a function.
type ByteEnumConverter ¶
type ByteEnumConverter interface { // Convert should convert an item type of byte into another item of byte. // It is suggested to return EndOfByteIterator to stop iteration. Convert(n int, val byte) (byte, error) }
ByteEnumConverter is an object converting an item type of byte and its ordering number.
var NoByteEnumConvert ByteEnumConverter = ByteEnumConvert( func(_ int, item byte) (byte, error) { return item, nil })
NoByteEnumConvert does nothing with item, just returns it as is.
func EnumByteConverterSeries ¶
func EnumByteConverterSeries(converters ...ByteEnumConverter) ByteEnumConverter
EnumByteConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
func EnumFromByteConverter ¶
func EnumFromByteConverter(converter ByteConverter) ByteEnumConverter
EnumFromByteConverter adapts checker type of ByteConverter to the interface ByteEnumConverter. If converter is nil it is return based on NoByteConvert enum checker.
type ByteEnumHandle ¶
ByteEnumHandle is a shortcut implementation of ByteEnumHandler based on a function.
type ByteEnumHandler ¶
type ByteEnumHandler interface { // Handle should do something with item of byte and its ordered number. // It is suggested to return EndOfByteIterator to stop iteration. Handle(int, byte) error }
ByteEnumHandler is an object handling an item type of byte and its ordered number.
func ByteEnumHandlerSeries ¶
func ByteEnumHandlerSeries(handlers ...ByteEnumHandler) ByteEnumHandler
ByteEnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type ByteEnumIterator ¶
type ByteEnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...ByteEnumHandler) error }
ByteEnumIterator is an iterator over items and their ordering numbers.
func MakeByteEnumIterator ¶
func MakeByteEnumIterator(maker ByteIterMaker) ByteEnumIterator
MakeByteEnumIterator constructs an instance implementing ByteEnumIterator based on ByteIterMaker.
func ToByteEnumIterator ¶
func ToByteEnumIterator(iter ByteIterator) ByteEnumIterator
ToByteEnumIterator constructs an instance implementing ByteEnumIterator based on ByteIterator.
type ByteHandle ¶
ByteHandle is a shortcut implementation of ByteHandler based on a function.
func (ByteHandle) Handle ¶
func (h ByteHandle) Handle(item byte) error
Handle does something with item of byte. It is suggested to return EndOfByteIterator to stop iteration.
type ByteHandler ¶
type ByteHandler interface { // Handle should do something with item of byte. // It is suggested to return EndOfByteIterator to stop iteration. Handle(byte) error }
ByteHandler is an object handling an item type of byte.
var ByteDoNothing ByteHandler = ByteHandle(func(_ byte) error { return nil })
ByteDoNothing does nothing.
func ByteHandlerSeries ¶
func ByteHandlerSeries(handlers ...ByteHandler) ByteHandler
ByteHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type ByteIterMaker ¶
type ByteIterMaker interface { // MakeIter should return a new instance of ByteIterator to iterate over it. MakeIter() ByteIterator }
ByteIterMaker is a maker of ByteIterator.
var MakeNoByteIter ByteIterMaker = MakeByteIter( func() ByteIterator { return EmptyByteIterator })
MakeNoByteIter is a zero value for ByteIterMaker. It always returns EmptyByteIterator and an empty error.
type ByteIterator ¶
type ByteIterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() byte // Err contains first met error while Next. Err() error }
ByteIterator is an iterator over items type of byte.
var EmptyByteIterator ByteIterator = emptyByteIterator{}
EmptyByteIterator is a zero value for ByteIterator. It is not contains any item to iterate over it.
func ByteConverting ¶
func ByteConverting(items ByteIterator, converters ...ByteConverter) ByteIterator
ByteConverting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func ByteDoingUntil ¶
func ByteDoingUntil(items ByteIterator, untilList ...ByteChecker) ByteIterator
ByteDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func ByteEnumConverting ¶
func ByteEnumConverting(items ByteIterator, converters ...ByteEnumConverter) ByteIterator
ByteEnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func ByteEnumDoingUntil ¶
func ByteEnumDoingUntil(items ByteIterator, untilList ...ByteEnumChecker) ByteIterator
ByteEnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func ByteEnumFiltering ¶
func ByteEnumFiltering(items ByteIterator, filters ...ByteEnumChecker) ByteIterator
ByteEnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func ByteEnumHandling ¶
func ByteEnumHandling(items ByteIterator, handlers ...ByteEnumHandler) ByteIterator
ByteEnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func ByteFiltering ¶
func ByteFiltering(items ByteIterator, filters ...ByteChecker) ByteIterator
ByteFiltering sets filter while iterating over items. If filters is empty, so all items will return.
func ByteGettingBatch ¶
func ByteGettingBatch(items ByteIterator, batchSize int) ByteIterator
ByteGettingBatch returns the next batch from items.
func ByteHandling ¶
func ByteHandling(items ByteIterator, handlers ...ByteHandler) ByteIterator
ByteHandling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func ByteInvert ¶
func ByteInvert(items ByteIterator) ByteIterator
ByteInvert unrolls items and make inverting iterator based on them.
func PriorByteEnumIterator ¶ added in v0.0.4
func PriorByteEnumIterator(comparer ByteEnumComparer, itemList ...ByteIterator) ByteIterator
PriorByteEnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorByteIterator ¶ added in v0.0.2
func PriorByteIterator(comparer ByteComparer, itemList ...ByteIterator) ByteIterator
PriorByteIterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperByteIterator ¶
func SuperByteIterator(itemList ...ByteIterator) ByteIterator
SuperByteIterator combines all iterators to one.
type ByteRangeIterator ¶
type ByteRangeIterator interface { // Range should iterate over items. Range(...ByteHandler) error }
ByteRangeIterator is an iterator over items.
func MakeByteRangeIterator ¶
func MakeByteRangeIterator(maker ByteIterMaker) ByteRangeIterator
MakeByteRangeIterator constructs an instance implementing ByteRangeIterator based on ByteIterMaker.
func ToByteRangeIterator ¶
func ToByteRangeIterator(iter ByteIterator) ByteRangeIterator
ToByteRangeIterator constructs an instance implementing ByteRangeIterator based on ByteIterator.
type ByteSlice ¶
type ByteSlice []byte
ByteSlice is a slice of byte.
func ByteUnroll ¶
func ByteUnroll(items ByteIterator) ByteSlice
ByteUnroll unrolls items to slice of byte.
func (ByteSlice) MakeIter ¶
func (s ByteSlice) MakeIter() ByteIterator
MakeIter returns a new instance of ByteIterator to iterate over it. It returns EmptyByteIterator if the error is not nil.
type ByteSliceIterator ¶
type ByteSliceIterator struct {
// contains filtered or unexported fields
}
ByteSliceIterator is an iterator based on a slice of byte.
func NewByteSliceIterator ¶ added in v0.0.2
func NewByteSliceIterator(slice []byte) *ByteSliceIterator
NewByteSliceIterator returns a new instance of ByteSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use ByteUnroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (ByteSliceIterator) Err ¶
func (ByteSliceIterator) Err() error
Err contains first met error while Next.
func (ByteSliceIterator) HasNext ¶
func (it ByteSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*ByteSliceIterator) Next ¶
func (it *ByteSliceIterator) Next() byte
Next returns next item in the iterator. It should be invoked after check HasNext.
type Checker ¶
type Checker interface { // Check should check an item type of interface{} for some condition. // It is suggested to return EndOfIterator to stop iteration. Check(interface{}) (bool, error) }
Checker is an object checking an item type of interface{} for some condition.
var ( // AlwaysCheckTrue always returns true and empty error. AlwaysCheckTrue Checker = Check( func(item interface{}) (bool, error) { return true, nil }) // AlwaysCheckFalse always returns false and empty error. AlwaysCheckFalse Checker = Check( func(item interface{}) (bool, error) { return false, nil }) )
func All ¶
All combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
type Compare ¶ added in v0.0.2
type Compare func(lhs, rhs interface{}) bool
Compare is a shortcut implementation of EnumComparer based on a function.
type Comparer ¶ added in v0.0.2
type Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs interface{}) bool }
EnumComparer is a strategy to compare two types.
type Convert ¶
type Convert func(interface{}) (interface{}, error)
Convert is a shortcut implementation of Converter based on a function.
type Converter ¶
type Converter interface { // Convert should convert an item type of interface{} into another item of interface{}. // It is suggested to return EndOfIterator to stop iteration. Convert(interface{}) (interface{}, error) }
Converter is an object converting an item type of interface{}.
var NoConvert Converter = Convert( func(item interface{}) (interface{}, error) { return item, nil })
NoConvert does nothing with item, just returns it as is.
func ConverterSeries ¶
ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type ConvertingByteIterator ¶
type ConvertingByteIterator struct {
// contains filtered or unexported fields
}
ConvertingByteIterator does iteration with converting by previously set converter.
func (*ConvertingByteIterator) HasNext ¶
func (it *ConvertingByteIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingInt16Iterator ¶
type ConvertingInt16Iterator struct {
// contains filtered or unexported fields
}
ConvertingInt16Iterator does iteration with converting by previously set converter.
func (*ConvertingInt16Iterator) HasNext ¶
func (it *ConvertingInt16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingInt32Iterator ¶
type ConvertingInt32Iterator struct {
// contains filtered or unexported fields
}
ConvertingInt32Iterator does iteration with converting by previously set converter.
func (*ConvertingInt32Iterator) HasNext ¶
func (it *ConvertingInt32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingInt64Iterator ¶
type ConvertingInt64Iterator struct {
// contains filtered or unexported fields
}
ConvertingInt64Iterator does iteration with converting by previously set converter.
func (*ConvertingInt64Iterator) HasNext ¶
func (it *ConvertingInt64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingInt8Iterator ¶
type ConvertingInt8Iterator struct {
// contains filtered or unexported fields
}
ConvertingInt8Iterator does iteration with converting by previously set converter.
func (*ConvertingInt8Iterator) HasNext ¶
func (it *ConvertingInt8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingIntIterator ¶
type ConvertingIntIterator struct {
// contains filtered or unexported fields
}
ConvertingIntIterator does iteration with converting by previously set converter.
func (*ConvertingIntIterator) HasNext ¶
func (it *ConvertingIntIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingIterator ¶
type ConvertingIterator struct {
// contains filtered or unexported fields
}
ConvertingIterator does iteration with converting by previously set converter.
func (*ConvertingIterator) HasNext ¶
func (it *ConvertingIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingRuneIterator ¶
type ConvertingRuneIterator struct {
// contains filtered or unexported fields
}
ConvertingRuneIterator does iteration with converting by previously set converter.
func (*ConvertingRuneIterator) HasNext ¶
func (it *ConvertingRuneIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingStringIterator ¶
type ConvertingStringIterator struct {
// contains filtered or unexported fields
}
ConvertingStringIterator does iteration with converting by previously set converter.
func (*ConvertingStringIterator) HasNext ¶
func (it *ConvertingStringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingUint16Iterator ¶
type ConvertingUint16Iterator struct {
// contains filtered or unexported fields
}
ConvertingUint16Iterator does iteration with converting by previously set converter.
func (*ConvertingUint16Iterator) HasNext ¶
func (it *ConvertingUint16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingUint32Iterator ¶
type ConvertingUint32Iterator struct {
// contains filtered or unexported fields
}
ConvertingUint32Iterator does iteration with converting by previously set converter.
func (*ConvertingUint32Iterator) HasNext ¶
func (it *ConvertingUint32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingUint64Iterator ¶
type ConvertingUint64Iterator struct {
// contains filtered or unexported fields
}
ConvertingUint64Iterator does iteration with converting by previously set converter.
func (*ConvertingUint64Iterator) HasNext ¶
func (it *ConvertingUint64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingUint8Iterator ¶
type ConvertingUint8Iterator struct {
// contains filtered or unexported fields
}
ConvertingUint8Iterator does iteration with converting by previously set converter.
func (*ConvertingUint8Iterator) HasNext ¶
func (it *ConvertingUint8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type ConvertingUintIterator ¶
type ConvertingUintIterator struct {
// contains filtered or unexported fields
}
ConvertingUintIterator does iteration with converting by previously set converter.
func (*ConvertingUintIterator) HasNext ¶
func (it *ConvertingUintIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilByteIterator ¶
type DoingUntilByteIterator struct {
// contains filtered or unexported fields
}
DoingUntilByteIterator does iteration until previously set checker is passed.
func (*DoingUntilByteIterator) HasNext ¶
func (it *DoingUntilByteIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilInt16Iterator ¶
type DoingUntilInt16Iterator struct {
// contains filtered or unexported fields
}
DoingUntilInt16Iterator does iteration until previously set checker is passed.
func (*DoingUntilInt16Iterator) HasNext ¶
func (it *DoingUntilInt16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilInt32Iterator ¶
type DoingUntilInt32Iterator struct {
// contains filtered or unexported fields
}
DoingUntilInt32Iterator does iteration until previously set checker is passed.
func (*DoingUntilInt32Iterator) HasNext ¶
func (it *DoingUntilInt32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilInt64Iterator ¶
type DoingUntilInt64Iterator struct {
// contains filtered or unexported fields
}
DoingUntilInt64Iterator does iteration until previously set checker is passed.
func (*DoingUntilInt64Iterator) HasNext ¶
func (it *DoingUntilInt64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilInt8Iterator ¶
type DoingUntilInt8Iterator struct {
// contains filtered or unexported fields
}
DoingUntilInt8Iterator does iteration until previously set checker is passed.
func (*DoingUntilInt8Iterator) HasNext ¶
func (it *DoingUntilInt8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilIntIterator ¶
type DoingUntilIntIterator struct {
// contains filtered or unexported fields
}
DoingUntilIntIterator does iteration until previously set checker is passed.
func (*DoingUntilIntIterator) HasNext ¶
func (it *DoingUntilIntIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilIterator ¶
type DoingUntilIterator struct {
// contains filtered or unexported fields
}
DoingUntilIterator does iteration until previously set checker is passed.
func (*DoingUntilIterator) HasNext ¶
func (it *DoingUntilIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilRuneIterator ¶
type DoingUntilRuneIterator struct {
// contains filtered or unexported fields
}
DoingUntilRuneIterator does iteration until previously set checker is passed.
func (*DoingUntilRuneIterator) HasNext ¶
func (it *DoingUntilRuneIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilStringIterator ¶
type DoingUntilStringIterator struct {
// contains filtered or unexported fields
}
DoingUntilStringIterator does iteration until previously set checker is passed.
func (*DoingUntilStringIterator) HasNext ¶
func (it *DoingUntilStringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilUint16Iterator ¶
type DoingUntilUint16Iterator struct {
// contains filtered or unexported fields
}
DoingUntilUint16Iterator does iteration until previously set checker is passed.
func (*DoingUntilUint16Iterator) HasNext ¶
func (it *DoingUntilUint16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilUint32Iterator ¶
type DoingUntilUint32Iterator struct {
// contains filtered or unexported fields
}
DoingUntilUint32Iterator does iteration until previously set checker is passed.
func (*DoingUntilUint32Iterator) HasNext ¶
func (it *DoingUntilUint32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilUint64Iterator ¶
type DoingUntilUint64Iterator struct {
// contains filtered or unexported fields
}
DoingUntilUint64Iterator does iteration until previously set checker is passed.
func (*DoingUntilUint64Iterator) HasNext ¶
func (it *DoingUntilUint64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilUint8Iterator ¶
type DoingUntilUint8Iterator struct {
// contains filtered or unexported fields
}
DoingUntilUint8Iterator does iteration until previously set checker is passed.
func (*DoingUntilUint8Iterator) HasNext ¶
func (it *DoingUntilUint8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type DoingUntilUintIterator ¶
type DoingUntilUintIterator struct {
// contains filtered or unexported fields
}
DoingUntilUintIterator does iteration until previously set checker is passed.
func (*DoingUntilUintIterator) HasNext ¶
func (it *DoingUntilUintIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumChecker ¶
type EnumChecker interface { // Check checks an item type of interface{} and its ordering number for some condition. // It is suggested to return EndOfIterator to stop iteration. Check(int, interface{}) (bool, error) }
EnumChecker is an object checking an item type of interface{} and its ordering number in for some condition.
func EnumAll ¶
func EnumAll(checkers ...EnumChecker) EnumChecker
EnumAll combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAny ¶
func EnumAny(checkers ...EnumChecker) EnumChecker
EnumAny combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromChecker ¶
func EnumFromChecker(checker Checker) EnumChecker
EnumFromChecker adapts checker type of Checker to the interface EnumChecker. If checker is nil it is return based on AlwaysCheckFalse enum checker.
func EnumNot ¶
func EnumNot(checker EnumChecker) EnumChecker
EnumNot do an inversion for checker result. It is returns AlwaysEnumCheckTrue if checker is nil.
type EnumCompare ¶ added in v0.0.4
EnumCompare is a shortcut implementation of EnumComparer based on a function.
type EnumComparer ¶ added in v0.0.4
type EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs interface{}, nRHS int, rhs interface{}) bool }
EnumComparer is a strategy to compare two types and their order numbers.
var EnumAlwaysLess EnumComparer = EnumCompare( func(_ int, _ interface{}, _ int, _ interface{}) bool { return true })
EnumAlwaysLess is an implementation of EnumComparer returning always true.
type EnumConvert ¶
EnumConvert is a shortcut implementation of EnumConverter based on a function.
func (EnumConvert) Convert ¶
func (c EnumConvert) Convert(n int, item interface{}) (interface{}, error)
Convert converts an item type of interface{} into another item of interface{}. It is suggested to return EndOfIterator to stop iteration.
type EnumConverter ¶
type EnumConverter interface { // Convert should convert an item type of interface{} into another item of interface{}. // It is suggested to return EndOfIterator to stop iteration. Convert(n int, val interface{}) (interface{}, error) }
EnumConverter is an object converting an item type of interface{} and its ordering number.
var NoEnumConvert EnumConverter = EnumConvert( func(_ int, item interface{}) (interface{}, error) { return item, nil })
NoEnumConvert does nothing with item, just returns it as is.
func EnumConverterSeries ¶
func EnumConverterSeries(converters ...EnumConverter) EnumConverter
EnumConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
func EnumFromConverter ¶
func EnumFromConverter(converter Converter) EnumConverter
EnumFromConverter adapts checker type of Converter to the interface EnumConverter. If converter is nil it is return based on NoConvert enum checker.
type EnumConvertingByteIterator ¶
type EnumConvertingByteIterator struct {
// contains filtered or unexported fields
}
EnumConvertingByteIterator does iteration with converting by previously set converter.
func (*EnumConvertingByteIterator) HasNext ¶
func (it *EnumConvertingByteIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingInt16Iterator ¶
type EnumConvertingInt16Iterator struct {
// contains filtered or unexported fields
}
EnumConvertingInt16Iterator does iteration with converting by previously set converter.
func (*EnumConvertingInt16Iterator) HasNext ¶
func (it *EnumConvertingInt16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingInt32Iterator ¶
type EnumConvertingInt32Iterator struct {
// contains filtered or unexported fields
}
EnumConvertingInt32Iterator does iteration with converting by previously set converter.
func (*EnumConvertingInt32Iterator) HasNext ¶
func (it *EnumConvertingInt32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingInt64Iterator ¶
type EnumConvertingInt64Iterator struct {
// contains filtered or unexported fields
}
EnumConvertingInt64Iterator does iteration with converting by previously set converter.
func (*EnumConvertingInt64Iterator) HasNext ¶
func (it *EnumConvertingInt64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingInt8Iterator ¶
type EnumConvertingInt8Iterator struct {
// contains filtered or unexported fields
}
EnumConvertingInt8Iterator does iteration with converting by previously set converter.
func (*EnumConvertingInt8Iterator) HasNext ¶
func (it *EnumConvertingInt8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingIntIterator ¶
type EnumConvertingIntIterator struct {
// contains filtered or unexported fields
}
EnumConvertingIntIterator does iteration with converting by previously set converter.
func (*EnumConvertingIntIterator) HasNext ¶
func (it *EnumConvertingIntIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingIterator ¶
type EnumConvertingIterator struct {
// contains filtered or unexported fields
}
EnumConvertingIterator does iteration with converting by previously set converter.
func (*EnumConvertingIterator) HasNext ¶
func (it *EnumConvertingIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingRuneIterator ¶
type EnumConvertingRuneIterator struct {
// contains filtered or unexported fields
}
EnumConvertingRuneIterator does iteration with converting by previously set converter.
func (*EnumConvertingRuneIterator) HasNext ¶
func (it *EnumConvertingRuneIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingStringIterator ¶
type EnumConvertingStringIterator struct {
// contains filtered or unexported fields
}
EnumConvertingStringIterator does iteration with converting by previously set converter.
func (*EnumConvertingStringIterator) HasNext ¶
func (it *EnumConvertingStringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingUint16Iterator ¶
type EnumConvertingUint16Iterator struct {
// contains filtered or unexported fields
}
EnumConvertingUint16Iterator does iteration with converting by previously set converter.
func (*EnumConvertingUint16Iterator) HasNext ¶
func (it *EnumConvertingUint16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingUint32Iterator ¶
type EnumConvertingUint32Iterator struct {
// contains filtered or unexported fields
}
EnumConvertingUint32Iterator does iteration with converting by previously set converter.
func (*EnumConvertingUint32Iterator) HasNext ¶
func (it *EnumConvertingUint32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingUint64Iterator ¶
type EnumConvertingUint64Iterator struct {
// contains filtered or unexported fields
}
EnumConvertingUint64Iterator does iteration with converting by previously set converter.
func (*EnumConvertingUint64Iterator) HasNext ¶
func (it *EnumConvertingUint64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingUint8Iterator ¶
type EnumConvertingUint8Iterator struct {
// contains filtered or unexported fields
}
EnumConvertingUint8Iterator does iteration with converting by previously set converter.
func (*EnumConvertingUint8Iterator) HasNext ¶
func (it *EnumConvertingUint8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumConvertingUintIterator ¶
type EnumConvertingUintIterator struct {
// contains filtered or unexported fields
}
EnumConvertingUintIterator does iteration with converting by previously set converter.
func (*EnumConvertingUintIterator) HasNext ¶
func (it *EnumConvertingUintIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilByteIterator ¶
type EnumDoingUntilByteIterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilByteIterator does iteration until previously set checker is passed.
func (*EnumDoingUntilByteIterator) HasNext ¶
func (it *EnumDoingUntilByteIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilInt16Iterator ¶
type EnumDoingUntilInt16Iterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilInt16Iterator does iteration until previously set checker is passed.
func (*EnumDoingUntilInt16Iterator) HasNext ¶
func (it *EnumDoingUntilInt16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilInt32Iterator ¶
type EnumDoingUntilInt32Iterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilInt32Iterator does iteration until previously set checker is passed.
func (*EnumDoingUntilInt32Iterator) HasNext ¶
func (it *EnumDoingUntilInt32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilInt64Iterator ¶
type EnumDoingUntilInt64Iterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilInt64Iterator does iteration until previously set checker is passed.
func (*EnumDoingUntilInt64Iterator) HasNext ¶
func (it *EnumDoingUntilInt64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilInt8Iterator ¶
type EnumDoingUntilInt8Iterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilInt8Iterator does iteration until previously set checker is passed.
func (*EnumDoingUntilInt8Iterator) HasNext ¶
func (it *EnumDoingUntilInt8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilIntIterator ¶
type EnumDoingUntilIntIterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilIntIterator does iteration until previously set checker is passed.
func (*EnumDoingUntilIntIterator) HasNext ¶
func (it *EnumDoingUntilIntIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilIterator ¶
type EnumDoingUntilIterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilIterator does iteration until previously set checker is passed.
func (*EnumDoingUntilIterator) HasNext ¶
func (it *EnumDoingUntilIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilRuneIterator ¶
type EnumDoingUntilRuneIterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilRuneIterator does iteration until previously set checker is passed.
func (*EnumDoingUntilRuneIterator) HasNext ¶
func (it *EnumDoingUntilRuneIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilStringIterator ¶
type EnumDoingUntilStringIterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilStringIterator does iteration until previously set checker is passed.
func (*EnumDoingUntilStringIterator) HasNext ¶
func (it *EnumDoingUntilStringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilUint16Iterator ¶
type EnumDoingUntilUint16Iterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilUint16Iterator does iteration until previously set checker is passed.
func (*EnumDoingUntilUint16Iterator) HasNext ¶
func (it *EnumDoingUntilUint16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilUint32Iterator ¶
type EnumDoingUntilUint32Iterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilUint32Iterator does iteration until previously set checker is passed.
func (*EnumDoingUntilUint32Iterator) HasNext ¶
func (it *EnumDoingUntilUint32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilUint64Iterator ¶
type EnumDoingUntilUint64Iterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilUint64Iterator does iteration until previously set checker is passed.
func (*EnumDoingUntilUint64Iterator) HasNext ¶
func (it *EnumDoingUntilUint64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilUint8Iterator ¶
type EnumDoingUntilUint8Iterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilUint8Iterator does iteration until previously set checker is passed.
func (*EnumDoingUntilUint8Iterator) HasNext ¶
func (it *EnumDoingUntilUint8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumDoingUntilUintIterator ¶
type EnumDoingUntilUintIterator struct {
// contains filtered or unexported fields
}
EnumDoingUntilUintIterator does iteration until previously set checker is passed.
func (*EnumDoingUntilUintIterator) HasNext ¶
func (it *EnumDoingUntilUintIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringByteIterator ¶
type EnumFilteringByteIterator struct {
// contains filtered or unexported fields
}
EnumFilteringByteIterator does iteration with filtering by previously set checker.
func (*EnumFilteringByteIterator) HasNext ¶
func (it *EnumFilteringByteIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringInt16Iterator ¶
type EnumFilteringInt16Iterator struct {
// contains filtered or unexported fields
}
EnumFilteringInt16Iterator does iteration with filtering by previously set checker.
func (*EnumFilteringInt16Iterator) HasNext ¶
func (it *EnumFilteringInt16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringInt32Iterator ¶
type EnumFilteringInt32Iterator struct {
// contains filtered or unexported fields
}
EnumFilteringInt32Iterator does iteration with filtering by previously set checker.
func (*EnumFilteringInt32Iterator) HasNext ¶
func (it *EnumFilteringInt32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringInt64Iterator ¶
type EnumFilteringInt64Iterator struct {
// contains filtered or unexported fields
}
EnumFilteringInt64Iterator does iteration with filtering by previously set checker.
func (*EnumFilteringInt64Iterator) HasNext ¶
func (it *EnumFilteringInt64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringInt8Iterator ¶
type EnumFilteringInt8Iterator struct {
// contains filtered or unexported fields
}
EnumFilteringInt8Iterator does iteration with filtering by previously set checker.
func (*EnumFilteringInt8Iterator) HasNext ¶
func (it *EnumFilteringInt8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringIntIterator ¶
type EnumFilteringIntIterator struct {
// contains filtered or unexported fields
}
EnumFilteringIntIterator does iteration with filtering by previously set checker.
func (*EnumFilteringIntIterator) HasNext ¶
func (it *EnumFilteringIntIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringIterator ¶
type EnumFilteringIterator struct {
// contains filtered or unexported fields
}
EnumFilteringIterator does iteration with filtering by previously set checker.
func (*EnumFilteringIterator) HasNext ¶
func (it *EnumFilteringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringRuneIterator ¶
type EnumFilteringRuneIterator struct {
// contains filtered or unexported fields
}
EnumFilteringRuneIterator does iteration with filtering by previously set checker.
func (*EnumFilteringRuneIterator) HasNext ¶
func (it *EnumFilteringRuneIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringStringIterator ¶
type EnumFilteringStringIterator struct {
// contains filtered or unexported fields
}
EnumFilteringStringIterator does iteration with filtering by previously set checker.
func (*EnumFilteringStringIterator) HasNext ¶
func (it *EnumFilteringStringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringUint16Iterator ¶
type EnumFilteringUint16Iterator struct {
// contains filtered or unexported fields
}
EnumFilteringUint16Iterator does iteration with filtering by previously set checker.
func (*EnumFilteringUint16Iterator) HasNext ¶
func (it *EnumFilteringUint16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringUint32Iterator ¶
type EnumFilteringUint32Iterator struct {
// contains filtered or unexported fields
}
EnumFilteringUint32Iterator does iteration with filtering by previously set checker.
func (*EnumFilteringUint32Iterator) HasNext ¶
func (it *EnumFilteringUint32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringUint64Iterator ¶
type EnumFilteringUint64Iterator struct {
// contains filtered or unexported fields
}
EnumFilteringUint64Iterator does iteration with filtering by previously set checker.
func (*EnumFilteringUint64Iterator) HasNext ¶
func (it *EnumFilteringUint64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringUint8Iterator ¶
type EnumFilteringUint8Iterator struct {
// contains filtered or unexported fields
}
EnumFilteringUint8Iterator does iteration with filtering by previously set checker.
func (*EnumFilteringUint8Iterator) HasNext ¶
func (it *EnumFilteringUint8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumFilteringUintIterator ¶
type EnumFilteringUintIterator struct {
// contains filtered or unexported fields
}
EnumFilteringUintIterator does iteration with filtering by previously set checker.
func (*EnumFilteringUintIterator) HasNext ¶
func (it *EnumFilteringUintIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandle ¶
EnumHandle is a shortcut implementation of EnumHandler based on a function.
func (EnumHandle) Handle ¶
func (h EnumHandle) Handle(n int, item interface{}) error
Handle does something with item of interface{} and its ordered number. It is suggested to return EndOfIterator to stop iteration.
type EnumHandler ¶
type EnumHandler interface { // Handle should do something with item of interface{} and its ordered number. // It is suggested to return EndOfIterator to stop iteration. Handle(int, interface{}) error }
EnumHandler is an object handling an item type of interface{} and its ordered number.
func EnumHandlerSeries ¶
func EnumHandlerSeries(handlers ...EnumHandler) EnumHandler
EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type EnumHandlingByteIterator ¶
type EnumHandlingByteIterator struct {
// contains filtered or unexported fields
}
EnumHandlingByteIterator does iteration with handling by previously set handler.
func (*EnumHandlingByteIterator) HasNext ¶
func (it *EnumHandlingByteIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingInt16Iterator ¶
type EnumHandlingInt16Iterator struct {
// contains filtered or unexported fields
}
EnumHandlingInt16Iterator does iteration with handling by previously set handler.
func (*EnumHandlingInt16Iterator) HasNext ¶
func (it *EnumHandlingInt16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingInt32Iterator ¶
type EnumHandlingInt32Iterator struct {
// contains filtered or unexported fields
}
EnumHandlingInt32Iterator does iteration with handling by previously set handler.
func (*EnumHandlingInt32Iterator) HasNext ¶
func (it *EnumHandlingInt32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingInt64Iterator ¶
type EnumHandlingInt64Iterator struct {
// contains filtered or unexported fields
}
EnumHandlingInt64Iterator does iteration with handling by previously set handler.
func (*EnumHandlingInt64Iterator) HasNext ¶
func (it *EnumHandlingInt64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingInt8Iterator ¶
type EnumHandlingInt8Iterator struct {
// contains filtered or unexported fields
}
EnumHandlingInt8Iterator does iteration with handling by previously set handler.
func (*EnumHandlingInt8Iterator) HasNext ¶
func (it *EnumHandlingInt8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingIntIterator ¶
type EnumHandlingIntIterator struct {
// contains filtered or unexported fields
}
EnumHandlingIntIterator does iteration with handling by previously set handler.
func (*EnumHandlingIntIterator) HasNext ¶
func (it *EnumHandlingIntIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingIterator ¶
type EnumHandlingIterator struct {
// contains filtered or unexported fields
}
EnumHandlingIterator does iteration with handling by previously set handler.
func (*EnumHandlingIterator) HasNext ¶
func (it *EnumHandlingIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingRuneIterator ¶
type EnumHandlingRuneIterator struct {
// contains filtered or unexported fields
}
EnumHandlingRuneIterator does iteration with handling by previously set handler.
func (*EnumHandlingRuneIterator) HasNext ¶
func (it *EnumHandlingRuneIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingStringIterator ¶
type EnumHandlingStringIterator struct {
// contains filtered or unexported fields
}
EnumHandlingStringIterator does iteration with handling by previously set handler.
func (*EnumHandlingStringIterator) HasNext ¶
func (it *EnumHandlingStringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingUint16Iterator ¶
type EnumHandlingUint16Iterator struct {
// contains filtered or unexported fields
}
EnumHandlingUint16Iterator does iteration with handling by previously set handler.
func (*EnumHandlingUint16Iterator) HasNext ¶
func (it *EnumHandlingUint16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingUint32Iterator ¶
type EnumHandlingUint32Iterator struct {
// contains filtered or unexported fields
}
EnumHandlingUint32Iterator does iteration with handling by previously set handler.
func (*EnumHandlingUint32Iterator) HasNext ¶
func (it *EnumHandlingUint32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingUint64Iterator ¶
type EnumHandlingUint64Iterator struct {
// contains filtered or unexported fields
}
EnumHandlingUint64Iterator does iteration with handling by previously set handler.
func (*EnumHandlingUint64Iterator) HasNext ¶
func (it *EnumHandlingUint64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingUint8Iterator ¶
type EnumHandlingUint8Iterator struct {
// contains filtered or unexported fields
}
EnumHandlingUint8Iterator does iteration with handling by previously set handler.
func (*EnumHandlingUint8Iterator) HasNext ¶
func (it *EnumHandlingUint8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumHandlingUintIterator ¶
type EnumHandlingUintIterator struct {
// contains filtered or unexported fields
}
EnumHandlingUintIterator does iteration with handling by previously set handler.
func (*EnumHandlingUintIterator) HasNext ¶
func (it *EnumHandlingUintIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type EnumIterator ¶
type EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...EnumHandler) error }
EnumIterator is an iterator over items and their ordering numbers.
func MakeEnumIterator ¶
func MakeEnumIterator(maker IterMaker) EnumIterator
MakeEnumIterator constructs an instance implementing EnumIterator based on IterMaker.
func ToEnumIterator ¶
func ToEnumIterator(iter Iterator) EnumIterator
ToEnumIterator constructs an instance implementing EnumIterator based on Iterator.
type FilteringByteIterator ¶
type FilteringByteIterator struct {
// contains filtered or unexported fields
}
FilteringByteIterator does iteration with filtering by previously set checker.
func (*FilteringByteIterator) HasNext ¶
func (it *FilteringByteIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringInt16Iterator ¶
type FilteringInt16Iterator struct {
// contains filtered or unexported fields
}
FilteringInt16Iterator does iteration with filtering by previously set checker.
func (*FilteringInt16Iterator) HasNext ¶
func (it *FilteringInt16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringInt32Iterator ¶
type FilteringInt32Iterator struct {
// contains filtered or unexported fields
}
FilteringInt32Iterator does iteration with filtering by previously set checker.
func (*FilteringInt32Iterator) HasNext ¶
func (it *FilteringInt32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringInt64Iterator ¶
type FilteringInt64Iterator struct {
// contains filtered or unexported fields
}
FilteringInt64Iterator does iteration with filtering by previously set checker.
func (*FilteringInt64Iterator) HasNext ¶
func (it *FilteringInt64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringInt8Iterator ¶
type FilteringInt8Iterator struct {
// contains filtered or unexported fields
}
FilteringInt8Iterator does iteration with filtering by previously set checker.
func (*FilteringInt8Iterator) HasNext ¶
func (it *FilteringInt8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringIntIterator ¶
type FilteringIntIterator struct {
// contains filtered or unexported fields
}
FilteringIntIterator does iteration with filtering by previously set checker.
func (*FilteringIntIterator) HasNext ¶
func (it *FilteringIntIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringIterator ¶
type FilteringIterator struct {
// contains filtered or unexported fields
}
FilteringIterator does iteration with filtering by previously set checker.
func (*FilteringIterator) HasNext ¶
func (it *FilteringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringRuneIterator ¶
type FilteringRuneIterator struct {
// contains filtered or unexported fields
}
FilteringRuneIterator does iteration with filtering by previously set checker.
func (*FilteringRuneIterator) HasNext ¶
func (it *FilteringRuneIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringStringIterator ¶
type FilteringStringIterator struct {
// contains filtered or unexported fields
}
FilteringStringIterator does iteration with filtering by previously set checker.
func (*FilteringStringIterator) HasNext ¶
func (it *FilteringStringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringUint16Iterator ¶
type FilteringUint16Iterator struct {
// contains filtered or unexported fields
}
FilteringUint16Iterator does iteration with filtering by previously set checker.
func (*FilteringUint16Iterator) HasNext ¶
func (it *FilteringUint16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringUint32Iterator ¶
type FilteringUint32Iterator struct {
// contains filtered or unexported fields
}
FilteringUint32Iterator does iteration with filtering by previously set checker.
func (*FilteringUint32Iterator) HasNext ¶
func (it *FilteringUint32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringUint64Iterator ¶
type FilteringUint64Iterator struct {
// contains filtered or unexported fields
}
FilteringUint64Iterator does iteration with filtering by previously set checker.
func (*FilteringUint64Iterator) HasNext ¶
func (it *FilteringUint64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringUint8Iterator ¶
type FilteringUint8Iterator struct {
// contains filtered or unexported fields
}
FilteringUint8Iterator does iteration with filtering by previously set checker.
func (*FilteringUint8Iterator) HasNext ¶
func (it *FilteringUint8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type FilteringUintIterator ¶
type FilteringUintIterator struct {
// contains filtered or unexported fields
}
FilteringUintIterator does iteration with filtering by previously set checker.
func (*FilteringUintIterator) HasNext ¶
func (it *FilteringUintIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type Handle ¶
type Handle func(interface{}) error
Handle is a shortcut implementation of Handler based on a function.
type Handler ¶
type Handler interface { // Handle should do something with item of interface{}. // It is suggested to return EndOfIterator to stop iteration. Handle(interface{}) error }
Handler is an object handling an item type of interface{}.
func HandlerSeries ¶
HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type HandlingByteIterator ¶
type HandlingByteIterator struct {
// contains filtered or unexported fields
}
HandlingByteIterator does iteration with handling by previously set handler.
func (*HandlingByteIterator) HasNext ¶
func (it *HandlingByteIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingInt16Iterator ¶
type HandlingInt16Iterator struct {
// contains filtered or unexported fields
}
HandlingInt16Iterator does iteration with handling by previously set handler.
func (*HandlingInt16Iterator) HasNext ¶
func (it *HandlingInt16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingInt32Iterator ¶
type HandlingInt32Iterator struct {
// contains filtered or unexported fields
}
HandlingInt32Iterator does iteration with handling by previously set handler.
func (*HandlingInt32Iterator) HasNext ¶
func (it *HandlingInt32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingInt64Iterator ¶
type HandlingInt64Iterator struct {
// contains filtered or unexported fields
}
HandlingInt64Iterator does iteration with handling by previously set handler.
func (*HandlingInt64Iterator) HasNext ¶
func (it *HandlingInt64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingInt8Iterator ¶
type HandlingInt8Iterator struct {
// contains filtered or unexported fields
}
HandlingInt8Iterator does iteration with handling by previously set handler.
func (*HandlingInt8Iterator) HasNext ¶
func (it *HandlingInt8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingIntIterator ¶
type HandlingIntIterator struct {
// contains filtered or unexported fields
}
HandlingIntIterator does iteration with handling by previously set handler.
func (*HandlingIntIterator) HasNext ¶
func (it *HandlingIntIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingIterator ¶
type HandlingIterator struct {
// contains filtered or unexported fields
}
HandlingIterator does iteration with handling by previously set handler.
func (*HandlingIterator) HasNext ¶
func (it *HandlingIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingRuneIterator ¶
type HandlingRuneIterator struct {
// contains filtered or unexported fields
}
HandlingRuneIterator does iteration with handling by previously set handler.
func (*HandlingRuneIterator) HasNext ¶
func (it *HandlingRuneIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingStringIterator ¶
type HandlingStringIterator struct {
// contains filtered or unexported fields
}
HandlingStringIterator does iteration with handling by previously set handler.
func (*HandlingStringIterator) HasNext ¶
func (it *HandlingStringIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingUint16Iterator ¶
type HandlingUint16Iterator struct {
// contains filtered or unexported fields
}
HandlingUint16Iterator does iteration with handling by previously set handler.
func (*HandlingUint16Iterator) HasNext ¶
func (it *HandlingUint16Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingUint32Iterator ¶
type HandlingUint32Iterator struct {
// contains filtered or unexported fields
}
HandlingUint32Iterator does iteration with handling by previously set handler.
func (*HandlingUint32Iterator) HasNext ¶
func (it *HandlingUint32Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingUint64Iterator ¶
type HandlingUint64Iterator struct {
// contains filtered or unexported fields
}
HandlingUint64Iterator does iteration with handling by previously set handler.
func (*HandlingUint64Iterator) HasNext ¶
func (it *HandlingUint64Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingUint8Iterator ¶
type HandlingUint8Iterator struct {
// contains filtered or unexported fields
}
HandlingUint8Iterator does iteration with handling by previously set handler.
func (*HandlingUint8Iterator) HasNext ¶
func (it *HandlingUint8Iterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type HandlingUintIterator ¶
type HandlingUintIterator struct {
// contains filtered or unexported fields
}
HandlingUintIterator does iteration with handling by previously set handler.
func (*HandlingUintIterator) HasNext ¶
func (it *HandlingUintIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
type Int16Check ¶
Int16Check is a shortcut implementation of Int16Checker based on a function.
type Int16Checker ¶
type Int16Checker interface { // Check should check an item type of int16 for some condition. // It is suggested to return EndOfInt16Iterator to stop iteration. Check(int16) (bool, error) }
Int16Checker is an object checking an item type of int16 for some condition.
var ( // AlwaysInt16CheckTrue always returns true and empty error. AlwaysInt16CheckTrue Int16Checker = Int16Check( func(item int16) (bool, error) { return true, nil }) // AlwaysInt16CheckFalse always returns false and empty error. AlwaysInt16CheckFalse Int16Checker = Int16Check( func(item int16) (bool, error) { return false, nil }) )
func AllInt16 ¶
func AllInt16(checkers ...Int16Checker) Int16Checker
AllInt16 combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyInt16 ¶
func AnyInt16(checkers ...Int16Checker) Int16Checker
AnyInt16 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotInt16 ¶
func NotInt16(checker Int16Checker) Int16Checker
NotInt16 do an inversion for checker result. It is returns AlwaysInt16CheckTrue if checker is nil.
type Int16Compare ¶ added in v0.0.2
Int16Compare is a shortcut implementation of Int16EnumComparer based on a function.
func (Int16Compare) IsLess ¶ added in v0.0.2
func (c Int16Compare) IsLess(lhs, rhs int16) bool
IsLess is true if lhs is less than rhs.
type Int16Comparer ¶ added in v0.0.2
type Int16Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs int16) bool }
Int16EnumComparer is a strategy to compare two types.
var Int16AlwaysLess Int16Comparer = Int16Compare(func(_, _ int16) bool { return true })
EnumInt16AlwaysLess is an implementation of Int16EnumComparer returning always true.
type Int16Convert ¶
Int16Convert is a shortcut implementation of Int16Converter based on a function.
type Int16Converter ¶
type Int16Converter interface { // Convert should convert an item type of int16 into another item of int16. // It is suggested to return EndOfInt16Iterator to stop iteration. Convert(int16) (int16, error) }
Int16Converter is an object converting an item type of int16.
var NoInt16Convert Int16Converter = Int16Convert( func(item int16) (int16, error) { return item, nil })
NoInt16Convert does nothing with item, just returns it as is.
func Int16ConverterSeries ¶
func Int16ConverterSeries(converters ...Int16Converter) Int16Converter
Int16ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Int16EnumCheck ¶
Int16EnumCheck is a shortcut implementation of Int16EnumChecker based on a function.
type Int16EnumChecker ¶
type Int16EnumChecker interface { // Check checks an item type of int16 and its ordering number for some condition. // It is suggested to return EndOfInt16Iterator to stop iteration. Check(int, int16) (bool, error) }
Int16EnumChecker is an object checking an item type of int16 and its ordering number in for some condition.
func EnumAllInt16 ¶
func EnumAllInt16(checkers ...Int16EnumChecker) Int16EnumChecker
EnumAllInt16 combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyInt16 ¶
func EnumAnyInt16(checkers ...Int16EnumChecker) Int16EnumChecker
EnumAnyInt16 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromInt16Checker ¶
func EnumFromInt16Checker(checker Int16Checker) Int16EnumChecker
EnumFromInt16Checker adapts checker type of Int16Checker to the interface Int16EnumChecker. If checker is nil it is return based on AlwaysInt16CheckFalse enum checker.
func EnumNotInt16 ¶
func EnumNotInt16(checker Int16EnumChecker) Int16EnumChecker
EnumNotInt16 do an inversion for checker result. It is returns AlwaysInt16EnumCheckTrue if checker is nil.
type Int16EnumCompare ¶ added in v0.0.4
Int16EnumCompare is a shortcut implementation of Int16EnumComparer based on a function.
type Int16EnumComparer ¶ added in v0.0.4
type Int16EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs int16, nRHS int, rhs int16) bool }
Int16EnumComparer is a strategy to compare two types and their order numbers.
var EnumInt16AlwaysLess Int16EnumComparer = Int16EnumCompare( func(_ int, _ int16, _ int, _ int16) bool { return true })
EnumInt16AlwaysLess is an implementation of Int16EnumComparer returning always true.
type Int16EnumConvert ¶
Int16EnumConvert is a shortcut implementation of Int16EnumConverter based on a function.
type Int16EnumConverter ¶
type Int16EnumConverter interface { // Convert should convert an item type of int16 into another item of int16. // It is suggested to return EndOfInt16Iterator to stop iteration. Convert(n int, val int16) (int16, error) }
Int16EnumConverter is an object converting an item type of int16 and its ordering number.
var NoInt16EnumConvert Int16EnumConverter = Int16EnumConvert( func(_ int, item int16) (int16, error) { return item, nil })
NoInt16EnumConvert does nothing with item, just returns it as is.
func EnumFromInt16Converter ¶
func EnumFromInt16Converter(converter Int16Converter) Int16EnumConverter
EnumFromInt16Converter adapts checker type of Int16Converter to the interface Int16EnumConverter. If converter is nil it is return based on NoInt16Convert enum checker.
func EnumInt16ConverterSeries ¶
func EnumInt16ConverterSeries(converters ...Int16EnumConverter) Int16EnumConverter
EnumInt16ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Int16EnumHandle ¶
Int16EnumHandle is a shortcut implementation of Int16EnumHandler based on a function.
type Int16EnumHandler ¶
type Int16EnumHandler interface { // Handle should do something with item of int16 and its ordered number. // It is suggested to return EndOfInt16Iterator to stop iteration. Handle(int, int16) error }
Int16EnumHandler is an object handling an item type of int16 and its ordered number.
func Int16EnumHandlerSeries ¶
func Int16EnumHandlerSeries(handlers ...Int16EnumHandler) Int16EnumHandler
Int16EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Int16EnumIterator ¶
type Int16EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...Int16EnumHandler) error }
Int16EnumIterator is an iterator over items and their ordering numbers.
func MakeInt16EnumIterator ¶
func MakeInt16EnumIterator(maker Int16IterMaker) Int16EnumIterator
MakeInt16EnumIterator constructs an instance implementing Int16EnumIterator based on Int16IterMaker.
func ToInt16EnumIterator ¶
func ToInt16EnumIterator(iter Int16Iterator) Int16EnumIterator
ToInt16EnumIterator constructs an instance implementing Int16EnumIterator based on Int16Iterator.
type Int16Handle ¶
Int16Handle is a shortcut implementation of Int16Handler based on a function.
func (Int16Handle) Handle ¶
func (h Int16Handle) Handle(item int16) error
Handle does something with item of int16. It is suggested to return EndOfInt16Iterator to stop iteration.
type Int16Handler ¶
type Int16Handler interface { // Handle should do something with item of int16. // It is suggested to return EndOfInt16Iterator to stop iteration. Handle(int16) error }
Int16Handler is an object handling an item type of int16.
var Int16DoNothing Int16Handler = Int16Handle(func(_ int16) error { return nil })
Int16DoNothing does nothing.
func Int16HandlerSeries ¶
func Int16HandlerSeries(handlers ...Int16Handler) Int16Handler
Int16HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Int16IterMaker ¶
type Int16IterMaker interface { // MakeIter should return a new instance of Int16Iterator to iterate over it. MakeIter() Int16Iterator }
Int16IterMaker is a maker of Int16Iterator.
var MakeNoInt16Iter Int16IterMaker = MakeInt16Iter( func() Int16Iterator { return EmptyInt16Iterator })
MakeNoInt16Iter is a zero value for Int16IterMaker. It always returns EmptyInt16Iterator and an empty error.
type Int16Iterator ¶
type Int16Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() int16 // Err contains first met error while Next. Err() error }
Int16Iterator is an iterator over items type of int16.
var EmptyInt16Iterator Int16Iterator = emptyInt16Iterator{}
EmptyInt16Iterator is a zero value for Int16Iterator. It is not contains any item to iterate over it.
func Int16Converting ¶
func Int16Converting(items Int16Iterator, converters ...Int16Converter) Int16Iterator
Int16Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func Int16DoingUntil ¶
func Int16DoingUntil(items Int16Iterator, untilList ...Int16Checker) Int16Iterator
Int16DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Int16EnumConverting ¶
func Int16EnumConverting(items Int16Iterator, converters ...Int16EnumConverter) Int16Iterator
Int16EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func Int16EnumDoingUntil ¶
func Int16EnumDoingUntil(items Int16Iterator, untilList ...Int16EnumChecker) Int16Iterator
Int16EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Int16EnumFiltering ¶
func Int16EnumFiltering(items Int16Iterator, filters ...Int16EnumChecker) Int16Iterator
Int16EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func Int16EnumHandling ¶
func Int16EnumHandling(items Int16Iterator, handlers ...Int16EnumHandler) Int16Iterator
Int16EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Int16Filtering ¶
func Int16Filtering(items Int16Iterator, filters ...Int16Checker) Int16Iterator
Int16Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func Int16GettingBatch ¶
func Int16GettingBatch(items Int16Iterator, batchSize int) Int16Iterator
Int16GettingBatch returns the next batch from items.
func Int16Handling ¶
func Int16Handling(items Int16Iterator, handlers ...Int16Handler) Int16Iterator
Int16Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func Int16Invert ¶
func Int16Invert(items Int16Iterator) Int16Iterator
Int16Invert unrolls items and make inverting iterator based on them.
func PriorInt16EnumIterator ¶ added in v0.0.4
func PriorInt16EnumIterator(comparer Int16EnumComparer, itemList ...Int16Iterator) Int16Iterator
PriorInt16EnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorInt16Iterator ¶ added in v0.0.2
func PriorInt16Iterator(comparer Int16Comparer, itemList ...Int16Iterator) Int16Iterator
PriorInt16Iterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperInt16Iterator ¶
func SuperInt16Iterator(itemList ...Int16Iterator) Int16Iterator
SuperInt16Iterator combines all iterators to one.
type Int16RangeIterator ¶
type Int16RangeIterator interface { // Range should iterate over items. Range(...Int16Handler) error }
Int16RangeIterator is an iterator over items.
func MakeInt16RangeIterator ¶
func MakeInt16RangeIterator(maker Int16IterMaker) Int16RangeIterator
MakeInt16RangeIterator constructs an instance implementing Int16RangeIterator based on Int16IterMaker.
func ToInt16RangeIterator ¶
func ToInt16RangeIterator(iter Int16Iterator) Int16RangeIterator
ToInt16RangeIterator constructs an instance implementing Int16RangeIterator based on Int16Iterator.
type Int16Slice ¶
type Int16Slice []int16
Int16Slice is a slice of int16.
func Int16Unroll ¶
func Int16Unroll(items Int16Iterator) Int16Slice
Int16Unroll unrolls items to slice of int16.
func (Int16Slice) MakeIter ¶
func (s Int16Slice) MakeIter() Int16Iterator
MakeIter returns a new instance of Int16Iterator to iterate over it. It returns EmptyInt16Iterator if the error is not nil.
type Int16SliceIterator ¶
type Int16SliceIterator struct {
// contains filtered or unexported fields
}
Int16SliceIterator is an iterator based on a slice of int16.
func NewInt16SliceIterator ¶ added in v0.0.2
func NewInt16SliceIterator(slice []int16) *Int16SliceIterator
NewInt16SliceIterator returns a new instance of Int16SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Int16Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (Int16SliceIterator) Err ¶
func (Int16SliceIterator) Err() error
Err contains first met error while Next.
func (Int16SliceIterator) HasNext ¶
func (it Int16SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*Int16SliceIterator) Next ¶
func (it *Int16SliceIterator) Next() int16
Next returns next item in the iterator. It should be invoked after check HasNext.
type Int32Check ¶
Int32Check is a shortcut implementation of Int32Checker based on a function.
type Int32Checker ¶
type Int32Checker interface { // Check should check an item type of int32 for some condition. // It is suggested to return EndOfInt32Iterator to stop iteration. Check(int32) (bool, error) }
Int32Checker is an object checking an item type of int32 for some condition.
var ( // AlwaysInt32CheckTrue always returns true and empty error. AlwaysInt32CheckTrue Int32Checker = Int32Check( func(item int32) (bool, error) { return true, nil }) // AlwaysInt32CheckFalse always returns false and empty error. AlwaysInt32CheckFalse Int32Checker = Int32Check( func(item int32) (bool, error) { return false, nil }) )
func AllInt32 ¶
func AllInt32(checkers ...Int32Checker) Int32Checker
AllInt32 combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyInt32 ¶
func AnyInt32(checkers ...Int32Checker) Int32Checker
AnyInt32 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotInt32 ¶
func NotInt32(checker Int32Checker) Int32Checker
NotInt32 do an inversion for checker result. It is returns AlwaysInt32CheckTrue if checker is nil.
type Int32Compare ¶ added in v0.0.2
Int32Compare is a shortcut implementation of Int32EnumComparer based on a function.
func (Int32Compare) IsLess ¶ added in v0.0.2
func (c Int32Compare) IsLess(lhs, rhs int32) bool
IsLess is true if lhs is less than rhs.
type Int32Comparer ¶ added in v0.0.2
type Int32Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs int32) bool }
Int32EnumComparer is a strategy to compare two types.
var Int32AlwaysLess Int32Comparer = Int32Compare(func(_, _ int32) bool { return true })
EnumInt32AlwaysLess is an implementation of Int32EnumComparer returning always true.
type Int32Convert ¶
Int32Convert is a shortcut implementation of Int32Converter based on a function.
type Int32Converter ¶
type Int32Converter interface { // Convert should convert an item type of int32 into another item of int32. // It is suggested to return EndOfInt32Iterator to stop iteration. Convert(int32) (int32, error) }
Int32Converter is an object converting an item type of int32.
var NoInt32Convert Int32Converter = Int32Convert( func(item int32) (int32, error) { return item, nil })
NoInt32Convert does nothing with item, just returns it as is.
func Int32ConverterSeries ¶
func Int32ConverterSeries(converters ...Int32Converter) Int32Converter
Int32ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Int32EnumCheck ¶
Int32EnumCheck is a shortcut implementation of Int32EnumChecker based on a function.
type Int32EnumChecker ¶
type Int32EnumChecker interface { // Check checks an item type of int32 and its ordering number for some condition. // It is suggested to return EndOfInt32Iterator to stop iteration. Check(int, int32) (bool, error) }
Int32EnumChecker is an object checking an item type of int32 and its ordering number in for some condition.
func EnumAllInt32 ¶
func EnumAllInt32(checkers ...Int32EnumChecker) Int32EnumChecker
EnumAllInt32 combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyInt32 ¶
func EnumAnyInt32(checkers ...Int32EnumChecker) Int32EnumChecker
EnumAnyInt32 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromInt32Checker ¶
func EnumFromInt32Checker(checker Int32Checker) Int32EnumChecker
EnumFromInt32Checker adapts checker type of Int32Checker to the interface Int32EnumChecker. If checker is nil it is return based on AlwaysInt32CheckFalse enum checker.
func EnumNotInt32 ¶
func EnumNotInt32(checker Int32EnumChecker) Int32EnumChecker
EnumNotInt32 do an inversion for checker result. It is returns AlwaysInt32EnumCheckTrue if checker is nil.
type Int32EnumCompare ¶ added in v0.0.4
Int32EnumCompare is a shortcut implementation of Int32EnumComparer based on a function.
type Int32EnumComparer ¶ added in v0.0.4
type Int32EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs int32, nRHS int, rhs int32) bool }
Int32EnumComparer is a strategy to compare two types and their order numbers.
var EnumInt32AlwaysLess Int32EnumComparer = Int32EnumCompare( func(_ int, _ int32, _ int, _ int32) bool { return true })
EnumInt32AlwaysLess is an implementation of Int32EnumComparer returning always true.
type Int32EnumConvert ¶
Int32EnumConvert is a shortcut implementation of Int32EnumConverter based on a function.
type Int32EnumConverter ¶
type Int32EnumConverter interface { // Convert should convert an item type of int32 into another item of int32. // It is suggested to return EndOfInt32Iterator to stop iteration. Convert(n int, val int32) (int32, error) }
Int32EnumConverter is an object converting an item type of int32 and its ordering number.
var NoInt32EnumConvert Int32EnumConverter = Int32EnumConvert( func(_ int, item int32) (int32, error) { return item, nil })
NoInt32EnumConvert does nothing with item, just returns it as is.
func EnumFromInt32Converter ¶
func EnumFromInt32Converter(converter Int32Converter) Int32EnumConverter
EnumFromInt32Converter adapts checker type of Int32Converter to the interface Int32EnumConverter. If converter is nil it is return based on NoInt32Convert enum checker.
func EnumInt32ConverterSeries ¶
func EnumInt32ConverterSeries(converters ...Int32EnumConverter) Int32EnumConverter
EnumInt32ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Int32EnumHandle ¶
Int32EnumHandle is a shortcut implementation of Int32EnumHandler based on a function.
type Int32EnumHandler ¶
type Int32EnumHandler interface { // Handle should do something with item of int32 and its ordered number. // It is suggested to return EndOfInt32Iterator to stop iteration. Handle(int, int32) error }
Int32EnumHandler is an object handling an item type of int32 and its ordered number.
func Int32EnumHandlerSeries ¶
func Int32EnumHandlerSeries(handlers ...Int32EnumHandler) Int32EnumHandler
Int32EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Int32EnumIterator ¶
type Int32EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...Int32EnumHandler) error }
Int32EnumIterator is an iterator over items and their ordering numbers.
func MakeInt32EnumIterator ¶
func MakeInt32EnumIterator(maker Int32IterMaker) Int32EnumIterator
MakeInt32EnumIterator constructs an instance implementing Int32EnumIterator based on Int32IterMaker.
func ToInt32EnumIterator ¶
func ToInt32EnumIterator(iter Int32Iterator) Int32EnumIterator
ToInt32EnumIterator constructs an instance implementing Int32EnumIterator based on Int32Iterator.
type Int32Handle ¶
Int32Handle is a shortcut implementation of Int32Handler based on a function.
func (Int32Handle) Handle ¶
func (h Int32Handle) Handle(item int32) error
Handle does something with item of int32. It is suggested to return EndOfInt32Iterator to stop iteration.
type Int32Handler ¶
type Int32Handler interface { // Handle should do something with item of int32. // It is suggested to return EndOfInt32Iterator to stop iteration. Handle(int32) error }
Int32Handler is an object handling an item type of int32.
var Int32DoNothing Int32Handler = Int32Handle(func(_ int32) error { return nil })
Int32DoNothing does nothing.
func Int32HandlerSeries ¶
func Int32HandlerSeries(handlers ...Int32Handler) Int32Handler
Int32HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Int32IterMaker ¶
type Int32IterMaker interface { // MakeIter should return a new instance of Int32Iterator to iterate over it. MakeIter() Int32Iterator }
Int32IterMaker is a maker of Int32Iterator.
var MakeNoInt32Iter Int32IterMaker = MakeInt32Iter( func() Int32Iterator { return EmptyInt32Iterator })
MakeNoInt32Iter is a zero value for Int32IterMaker. It always returns EmptyInt32Iterator and an empty error.
type Int32Iterator ¶
type Int32Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() int32 // Err contains first met error while Next. Err() error }
Int32Iterator is an iterator over items type of int32.
var EmptyInt32Iterator Int32Iterator = emptyInt32Iterator{}
EmptyInt32Iterator is a zero value for Int32Iterator. It is not contains any item to iterate over it.
func Int32Converting ¶
func Int32Converting(items Int32Iterator, converters ...Int32Converter) Int32Iterator
Int32Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func Int32DoingUntil ¶
func Int32DoingUntil(items Int32Iterator, untilList ...Int32Checker) Int32Iterator
Int32DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Int32EnumConverting ¶
func Int32EnumConverting(items Int32Iterator, converters ...Int32EnumConverter) Int32Iterator
Int32EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func Int32EnumDoingUntil ¶
func Int32EnumDoingUntil(items Int32Iterator, untilList ...Int32EnumChecker) Int32Iterator
Int32EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Int32EnumFiltering ¶
func Int32EnumFiltering(items Int32Iterator, filters ...Int32EnumChecker) Int32Iterator
Int32EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func Int32EnumHandling ¶
func Int32EnumHandling(items Int32Iterator, handlers ...Int32EnumHandler) Int32Iterator
Int32EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Int32Filtering ¶
func Int32Filtering(items Int32Iterator, filters ...Int32Checker) Int32Iterator
Int32Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func Int32GettingBatch ¶
func Int32GettingBatch(items Int32Iterator, batchSize int) Int32Iterator
Int32GettingBatch returns the next batch from items.
func Int32Handling ¶
func Int32Handling(items Int32Iterator, handlers ...Int32Handler) Int32Iterator
Int32Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func Int32Invert ¶
func Int32Invert(items Int32Iterator) Int32Iterator
Int32Invert unrolls items and make inverting iterator based on them.
func PriorInt32EnumIterator ¶ added in v0.0.4
func PriorInt32EnumIterator(comparer Int32EnumComparer, itemList ...Int32Iterator) Int32Iterator
PriorInt32EnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorInt32Iterator ¶ added in v0.0.2
func PriorInt32Iterator(comparer Int32Comparer, itemList ...Int32Iterator) Int32Iterator
PriorInt32Iterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperInt32Iterator ¶
func SuperInt32Iterator(itemList ...Int32Iterator) Int32Iterator
SuperInt32Iterator combines all iterators to one.
type Int32RangeIterator ¶
type Int32RangeIterator interface { // Range should iterate over items. Range(...Int32Handler) error }
Int32RangeIterator is an iterator over items.
func MakeInt32RangeIterator ¶
func MakeInt32RangeIterator(maker Int32IterMaker) Int32RangeIterator
MakeInt32RangeIterator constructs an instance implementing Int32RangeIterator based on Int32IterMaker.
func ToInt32RangeIterator ¶
func ToInt32RangeIterator(iter Int32Iterator) Int32RangeIterator
ToInt32RangeIterator constructs an instance implementing Int32RangeIterator based on Int32Iterator.
type Int32Slice ¶
type Int32Slice []int32
Int32Slice is a slice of int32.
func Int32Unroll ¶
func Int32Unroll(items Int32Iterator) Int32Slice
Int32Unroll unrolls items to slice of int32.
func (Int32Slice) MakeIter ¶
func (s Int32Slice) MakeIter() Int32Iterator
MakeIter returns a new instance of Int32Iterator to iterate over it. It returns EmptyInt32Iterator if the error is not nil.
type Int32SliceIterator ¶
type Int32SliceIterator struct {
// contains filtered or unexported fields
}
Int32SliceIterator is an iterator based on a slice of int32.
func NewInt32SliceIterator ¶ added in v0.0.2
func NewInt32SliceIterator(slice []int32) *Int32SliceIterator
NewInt32SliceIterator returns a new instance of Int32SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Int32Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (Int32SliceIterator) Err ¶
func (Int32SliceIterator) Err() error
Err contains first met error while Next.
func (Int32SliceIterator) HasNext ¶
func (it Int32SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*Int32SliceIterator) Next ¶
func (it *Int32SliceIterator) Next() int32
Next returns next item in the iterator. It should be invoked after check HasNext.
type Int64Check ¶
Int64Check is a shortcut implementation of Int64Checker based on a function.
type Int64Checker ¶
type Int64Checker interface { // Check should check an item type of int64 for some condition. // It is suggested to return EndOfInt64Iterator to stop iteration. Check(int64) (bool, error) }
Int64Checker is an object checking an item type of int64 for some condition.
var ( // AlwaysInt64CheckTrue always returns true and empty error. AlwaysInt64CheckTrue Int64Checker = Int64Check( func(item int64) (bool, error) { return true, nil }) // AlwaysInt64CheckFalse always returns false and empty error. AlwaysInt64CheckFalse Int64Checker = Int64Check( func(item int64) (bool, error) { return false, nil }) )
func AllInt64 ¶
func AllInt64(checkers ...Int64Checker) Int64Checker
AllInt64 combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyInt64 ¶
func AnyInt64(checkers ...Int64Checker) Int64Checker
AnyInt64 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotInt64 ¶
func NotInt64(checker Int64Checker) Int64Checker
NotInt64 do an inversion for checker result. It is returns AlwaysInt64CheckTrue if checker is nil.
type Int64Compare ¶ added in v0.0.2
Int64Compare is a shortcut implementation of Int64EnumComparer based on a function.
func (Int64Compare) IsLess ¶ added in v0.0.2
func (c Int64Compare) IsLess(lhs, rhs int64) bool
IsLess is true if lhs is less than rhs.
type Int64Comparer ¶ added in v0.0.2
type Int64Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs int64) bool }
Int64EnumComparer is a strategy to compare two types.
var Int64AlwaysLess Int64Comparer = Int64Compare(func(_, _ int64) bool { return true })
EnumInt64AlwaysLess is an implementation of Int64EnumComparer returning always true.
type Int64Convert ¶
Int64Convert is a shortcut implementation of Int64Converter based on a function.
type Int64Converter ¶
type Int64Converter interface { // Convert should convert an item type of int64 into another item of int64. // It is suggested to return EndOfInt64Iterator to stop iteration. Convert(int64) (int64, error) }
Int64Converter is an object converting an item type of int64.
var NoInt64Convert Int64Converter = Int64Convert( func(item int64) (int64, error) { return item, nil })
NoInt64Convert does nothing with item, just returns it as is.
func Int64ConverterSeries ¶
func Int64ConverterSeries(converters ...Int64Converter) Int64Converter
Int64ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Int64EnumCheck ¶
Int64EnumCheck is a shortcut implementation of Int64EnumChecker based on a function.
type Int64EnumChecker ¶
type Int64EnumChecker interface { // Check checks an item type of int64 and its ordering number for some condition. // It is suggested to return EndOfInt64Iterator to stop iteration. Check(int, int64) (bool, error) }
Int64EnumChecker is an object checking an item type of int64 and its ordering number in for some condition.
func EnumAllInt64 ¶
func EnumAllInt64(checkers ...Int64EnumChecker) Int64EnumChecker
EnumAllInt64 combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyInt64 ¶
func EnumAnyInt64(checkers ...Int64EnumChecker) Int64EnumChecker
EnumAnyInt64 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromInt64Checker ¶
func EnumFromInt64Checker(checker Int64Checker) Int64EnumChecker
EnumFromInt64Checker adapts checker type of Int64Checker to the interface Int64EnumChecker. If checker is nil it is return based on AlwaysInt64CheckFalse enum checker.
func EnumNotInt64 ¶
func EnumNotInt64(checker Int64EnumChecker) Int64EnumChecker
EnumNotInt64 do an inversion for checker result. It is returns AlwaysInt64EnumCheckTrue if checker is nil.
type Int64EnumCompare ¶ added in v0.0.4
Int64EnumCompare is a shortcut implementation of Int64EnumComparer based on a function.
type Int64EnumComparer ¶ added in v0.0.4
type Int64EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs int64, nRHS int, rhs int64) bool }
Int64EnumComparer is a strategy to compare two types and their order numbers.
var EnumInt64AlwaysLess Int64EnumComparer = Int64EnumCompare( func(_ int, _ int64, _ int, _ int64) bool { return true })
EnumInt64AlwaysLess is an implementation of Int64EnumComparer returning always true.
type Int64EnumConvert ¶
Int64EnumConvert is a shortcut implementation of Int64EnumConverter based on a function.
type Int64EnumConverter ¶
type Int64EnumConverter interface { // Convert should convert an item type of int64 into another item of int64. // It is suggested to return EndOfInt64Iterator to stop iteration. Convert(n int, val int64) (int64, error) }
Int64EnumConverter is an object converting an item type of int64 and its ordering number.
var NoInt64EnumConvert Int64EnumConverter = Int64EnumConvert( func(_ int, item int64) (int64, error) { return item, nil })
NoInt64EnumConvert does nothing with item, just returns it as is.
func EnumFromInt64Converter ¶
func EnumFromInt64Converter(converter Int64Converter) Int64EnumConverter
EnumFromInt64Converter adapts checker type of Int64Converter to the interface Int64EnumConverter. If converter is nil it is return based on NoInt64Convert enum checker.
func EnumInt64ConverterSeries ¶
func EnumInt64ConverterSeries(converters ...Int64EnumConverter) Int64EnumConverter
EnumInt64ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Int64EnumHandle ¶
Int64EnumHandle is a shortcut implementation of Int64EnumHandler based on a function.
type Int64EnumHandler ¶
type Int64EnumHandler interface { // Handle should do something with item of int64 and its ordered number. // It is suggested to return EndOfInt64Iterator to stop iteration. Handle(int, int64) error }
Int64EnumHandler is an object handling an item type of int64 and its ordered number.
func Int64EnumHandlerSeries ¶
func Int64EnumHandlerSeries(handlers ...Int64EnumHandler) Int64EnumHandler
Int64EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Int64EnumIterator ¶
type Int64EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...Int64EnumHandler) error }
Int64EnumIterator is an iterator over items and their ordering numbers.
func MakeInt64EnumIterator ¶
func MakeInt64EnumIterator(maker Int64IterMaker) Int64EnumIterator
MakeInt64EnumIterator constructs an instance implementing Int64EnumIterator based on Int64IterMaker.
func ToInt64EnumIterator ¶
func ToInt64EnumIterator(iter Int64Iterator) Int64EnumIterator
ToInt64EnumIterator constructs an instance implementing Int64EnumIterator based on Int64Iterator.
type Int64Handle ¶
Int64Handle is a shortcut implementation of Int64Handler based on a function.
func (Int64Handle) Handle ¶
func (h Int64Handle) Handle(item int64) error
Handle does something with item of int64. It is suggested to return EndOfInt64Iterator to stop iteration.
type Int64Handler ¶
type Int64Handler interface { // Handle should do something with item of int64. // It is suggested to return EndOfInt64Iterator to stop iteration. Handle(int64) error }
Int64Handler is an object handling an item type of int64.
var Int64DoNothing Int64Handler = Int64Handle(func(_ int64) error { return nil })
Int64DoNothing does nothing.
func Int64HandlerSeries ¶
func Int64HandlerSeries(handlers ...Int64Handler) Int64Handler
Int64HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Int64IterMaker ¶
type Int64IterMaker interface { // MakeIter should return a new instance of Int64Iterator to iterate over it. MakeIter() Int64Iterator }
Int64IterMaker is a maker of Int64Iterator.
var MakeNoInt64Iter Int64IterMaker = MakeInt64Iter( func() Int64Iterator { return EmptyInt64Iterator })
MakeNoInt64Iter is a zero value for Int64IterMaker. It always returns EmptyInt64Iterator and an empty error.
type Int64Iterator ¶
type Int64Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() int64 // Err contains first met error while Next. Err() error }
Int64Iterator is an iterator over items type of int64.
var EmptyInt64Iterator Int64Iterator = emptyInt64Iterator{}
EmptyInt64Iterator is a zero value for Int64Iterator. It is not contains any item to iterate over it.
func Int64Converting ¶
func Int64Converting(items Int64Iterator, converters ...Int64Converter) Int64Iterator
Int64Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func Int64DoingUntil ¶
func Int64DoingUntil(items Int64Iterator, untilList ...Int64Checker) Int64Iterator
Int64DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Int64EnumConverting ¶
func Int64EnumConverting(items Int64Iterator, converters ...Int64EnumConverter) Int64Iterator
Int64EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func Int64EnumDoingUntil ¶
func Int64EnumDoingUntil(items Int64Iterator, untilList ...Int64EnumChecker) Int64Iterator
Int64EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Int64EnumFiltering ¶
func Int64EnumFiltering(items Int64Iterator, filters ...Int64EnumChecker) Int64Iterator
Int64EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func Int64EnumHandling ¶
func Int64EnumHandling(items Int64Iterator, handlers ...Int64EnumHandler) Int64Iterator
Int64EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Int64Filtering ¶
func Int64Filtering(items Int64Iterator, filters ...Int64Checker) Int64Iterator
Int64Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func Int64GettingBatch ¶
func Int64GettingBatch(items Int64Iterator, batchSize int) Int64Iterator
Int64GettingBatch returns the next batch from items.
func Int64Handling ¶
func Int64Handling(items Int64Iterator, handlers ...Int64Handler) Int64Iterator
Int64Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func Int64Invert ¶
func Int64Invert(items Int64Iterator) Int64Iterator
Int64Invert unrolls items and make inverting iterator based on them.
func PriorInt64EnumIterator ¶ added in v0.0.4
func PriorInt64EnumIterator(comparer Int64EnumComparer, itemList ...Int64Iterator) Int64Iterator
PriorInt64EnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorInt64Iterator ¶ added in v0.0.2
func PriorInt64Iterator(comparer Int64Comparer, itemList ...Int64Iterator) Int64Iterator
PriorInt64Iterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperInt64Iterator ¶
func SuperInt64Iterator(itemList ...Int64Iterator) Int64Iterator
SuperInt64Iterator combines all iterators to one.
type Int64RangeIterator ¶
type Int64RangeIterator interface { // Range should iterate over items. Range(...Int64Handler) error }
Int64RangeIterator is an iterator over items.
func MakeInt64RangeIterator ¶
func MakeInt64RangeIterator(maker Int64IterMaker) Int64RangeIterator
MakeInt64RangeIterator constructs an instance implementing Int64RangeIterator based on Int64IterMaker.
func ToInt64RangeIterator ¶
func ToInt64RangeIterator(iter Int64Iterator) Int64RangeIterator
ToInt64RangeIterator constructs an instance implementing Int64RangeIterator based on Int64Iterator.
type Int64Slice ¶
type Int64Slice []int64
Int64Slice is a slice of int64.
func Int64Unroll ¶
func Int64Unroll(items Int64Iterator) Int64Slice
Int64Unroll unrolls items to slice of int64.
func (Int64Slice) MakeIter ¶
func (s Int64Slice) MakeIter() Int64Iterator
MakeIter returns a new instance of Int64Iterator to iterate over it. It returns EmptyInt64Iterator if the error is not nil.
type Int64SliceIterator ¶
type Int64SliceIterator struct {
// contains filtered or unexported fields
}
Int64SliceIterator is an iterator based on a slice of int64.
func NewInt64SliceIterator ¶ added in v0.0.2
func NewInt64SliceIterator(slice []int64) *Int64SliceIterator
NewInt64SliceIterator returns a new instance of Int64SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Int64Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (Int64SliceIterator) Err ¶
func (Int64SliceIterator) Err() error
Err contains first met error while Next.
func (Int64SliceIterator) HasNext ¶
func (it Int64SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*Int64SliceIterator) Next ¶
func (it *Int64SliceIterator) Next() int64
Next returns next item in the iterator. It should be invoked after check HasNext.
type Int8Checker ¶
type Int8Checker interface { // Check should check an item type of int8 for some condition. // It is suggested to return EndOfInt8Iterator to stop iteration. Check(int8) (bool, error) }
Int8Checker is an object checking an item type of int8 for some condition.
var ( // AlwaysInt8CheckTrue always returns true and empty error. AlwaysInt8CheckTrue Int8Checker = Int8Check( func(item int8) (bool, error) { return true, nil }) // AlwaysInt8CheckFalse always returns false and empty error. AlwaysInt8CheckFalse Int8Checker = Int8Check( func(item int8) (bool, error) { return false, nil }) )
func AllInt8 ¶
func AllInt8(checkers ...Int8Checker) Int8Checker
AllInt8 combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyInt8 ¶
func AnyInt8(checkers ...Int8Checker) Int8Checker
AnyInt8 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotInt8 ¶
func NotInt8(checker Int8Checker) Int8Checker
NotInt8 do an inversion for checker result. It is returns AlwaysInt8CheckTrue if checker is nil.
type Int8Compare ¶ added in v0.0.2
Int8Compare is a shortcut implementation of Int8EnumComparer based on a function.
func (Int8Compare) IsLess ¶ added in v0.0.2
func (c Int8Compare) IsLess(lhs, rhs int8) bool
IsLess is true if lhs is less than rhs.
type Int8Comparer ¶ added in v0.0.2
type Int8Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs int8) bool }
Int8EnumComparer is a strategy to compare two types.
var Int8AlwaysLess Int8Comparer = Int8Compare(func(_, _ int8) bool { return true })
EnumInt8AlwaysLess is an implementation of Int8EnumComparer returning always true.
type Int8Convert ¶
Int8Convert is a shortcut implementation of Int8Converter based on a function.
type Int8Converter ¶
type Int8Converter interface { // Convert should convert an item type of int8 into another item of int8. // It is suggested to return EndOfInt8Iterator to stop iteration. Convert(int8) (int8, error) }
Int8Converter is an object converting an item type of int8.
var NoInt8Convert Int8Converter = Int8Convert( func(item int8) (int8, error) { return item, nil })
NoInt8Convert does nothing with item, just returns it as is.
func Int8ConverterSeries ¶
func Int8ConverterSeries(converters ...Int8Converter) Int8Converter
Int8ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Int8EnumCheck ¶
Int8EnumCheck is a shortcut implementation of Int8EnumChecker based on a function.
type Int8EnumChecker ¶
type Int8EnumChecker interface { // Check checks an item type of int8 and its ordering number for some condition. // It is suggested to return EndOfInt8Iterator to stop iteration. Check(int, int8) (bool, error) }
Int8EnumChecker is an object checking an item type of int8 and its ordering number in for some condition.
func EnumAllInt8 ¶
func EnumAllInt8(checkers ...Int8EnumChecker) Int8EnumChecker
EnumAllInt8 combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyInt8 ¶
func EnumAnyInt8(checkers ...Int8EnumChecker) Int8EnumChecker
EnumAnyInt8 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromInt8Checker ¶
func EnumFromInt8Checker(checker Int8Checker) Int8EnumChecker
EnumFromInt8Checker adapts checker type of Int8Checker to the interface Int8EnumChecker. If checker is nil it is return based on AlwaysInt8CheckFalse enum checker.
func EnumNotInt8 ¶
func EnumNotInt8(checker Int8EnumChecker) Int8EnumChecker
EnumNotInt8 do an inversion for checker result. It is returns AlwaysInt8EnumCheckTrue if checker is nil.
type Int8EnumCompare ¶ added in v0.0.4
Int8EnumCompare is a shortcut implementation of Int8EnumComparer based on a function.
type Int8EnumComparer ¶ added in v0.0.4
type Int8EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs int8, nRHS int, rhs int8) bool }
Int8EnumComparer is a strategy to compare two types and their order numbers.
var EnumInt8AlwaysLess Int8EnumComparer = Int8EnumCompare( func(_ int, _ int8, _ int, _ int8) bool { return true })
EnumInt8AlwaysLess is an implementation of Int8EnumComparer returning always true.
type Int8EnumConvert ¶
Int8EnumConvert is a shortcut implementation of Int8EnumConverter based on a function.
type Int8EnumConverter ¶
type Int8EnumConverter interface { // Convert should convert an item type of int8 into another item of int8. // It is suggested to return EndOfInt8Iterator to stop iteration. Convert(n int, val int8) (int8, error) }
Int8EnumConverter is an object converting an item type of int8 and its ordering number.
var NoInt8EnumConvert Int8EnumConverter = Int8EnumConvert( func(_ int, item int8) (int8, error) { return item, nil })
NoInt8EnumConvert does nothing with item, just returns it as is.
func EnumFromInt8Converter ¶
func EnumFromInt8Converter(converter Int8Converter) Int8EnumConverter
EnumFromInt8Converter adapts checker type of Int8Converter to the interface Int8EnumConverter. If converter is nil it is return based on NoInt8Convert enum checker.
func EnumInt8ConverterSeries ¶
func EnumInt8ConverterSeries(converters ...Int8EnumConverter) Int8EnumConverter
EnumInt8ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Int8EnumHandle ¶
Int8EnumHandle is a shortcut implementation of Int8EnumHandler based on a function.
type Int8EnumHandler ¶
type Int8EnumHandler interface { // Handle should do something with item of int8 and its ordered number. // It is suggested to return EndOfInt8Iterator to stop iteration. Handle(int, int8) error }
Int8EnumHandler is an object handling an item type of int8 and its ordered number.
func Int8EnumHandlerSeries ¶
func Int8EnumHandlerSeries(handlers ...Int8EnumHandler) Int8EnumHandler
Int8EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Int8EnumIterator ¶
type Int8EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...Int8EnumHandler) error }
Int8EnumIterator is an iterator over items and their ordering numbers.
func MakeInt8EnumIterator ¶
func MakeInt8EnumIterator(maker Int8IterMaker) Int8EnumIterator
MakeInt8EnumIterator constructs an instance implementing Int8EnumIterator based on Int8IterMaker.
func ToInt8EnumIterator ¶
func ToInt8EnumIterator(iter Int8Iterator) Int8EnumIterator
ToInt8EnumIterator constructs an instance implementing Int8EnumIterator based on Int8Iterator.
type Int8Handle ¶
Int8Handle is a shortcut implementation of Int8Handler based on a function.
func (Int8Handle) Handle ¶
func (h Int8Handle) Handle(item int8) error
Handle does something with item of int8. It is suggested to return EndOfInt8Iterator to stop iteration.
type Int8Handler ¶
type Int8Handler interface { // Handle should do something with item of int8. // It is suggested to return EndOfInt8Iterator to stop iteration. Handle(int8) error }
Int8Handler is an object handling an item type of int8.
var Int8DoNothing Int8Handler = Int8Handle(func(_ int8) error { return nil })
Int8DoNothing does nothing.
func Int8HandlerSeries ¶
func Int8HandlerSeries(handlers ...Int8Handler) Int8Handler
Int8HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Int8IterMaker ¶
type Int8IterMaker interface { // MakeIter should return a new instance of Int8Iterator to iterate over it. MakeIter() Int8Iterator }
Int8IterMaker is a maker of Int8Iterator.
var MakeNoInt8Iter Int8IterMaker = MakeInt8Iter( func() Int8Iterator { return EmptyInt8Iterator })
MakeNoInt8Iter is a zero value for Int8IterMaker. It always returns EmptyInt8Iterator and an empty error.
type Int8Iterator ¶
type Int8Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() int8 // Err contains first met error while Next. Err() error }
Int8Iterator is an iterator over items type of int8.
var EmptyInt8Iterator Int8Iterator = emptyInt8Iterator{}
EmptyInt8Iterator is a zero value for Int8Iterator. It is not contains any item to iterate over it.
func Int8Converting ¶
func Int8Converting(items Int8Iterator, converters ...Int8Converter) Int8Iterator
Int8Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func Int8DoingUntil ¶
func Int8DoingUntil(items Int8Iterator, untilList ...Int8Checker) Int8Iterator
Int8DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Int8EnumConverting ¶
func Int8EnumConverting(items Int8Iterator, converters ...Int8EnumConverter) Int8Iterator
Int8EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func Int8EnumDoingUntil ¶
func Int8EnumDoingUntil(items Int8Iterator, untilList ...Int8EnumChecker) Int8Iterator
Int8EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Int8EnumFiltering ¶
func Int8EnumFiltering(items Int8Iterator, filters ...Int8EnumChecker) Int8Iterator
Int8EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func Int8EnumHandling ¶
func Int8EnumHandling(items Int8Iterator, handlers ...Int8EnumHandler) Int8Iterator
Int8EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Int8Filtering ¶
func Int8Filtering(items Int8Iterator, filters ...Int8Checker) Int8Iterator
Int8Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func Int8GettingBatch ¶
func Int8GettingBatch(items Int8Iterator, batchSize int) Int8Iterator
Int8GettingBatch returns the next batch from items.
func Int8Handling ¶
func Int8Handling(items Int8Iterator, handlers ...Int8Handler) Int8Iterator
Int8Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func Int8Invert ¶
func Int8Invert(items Int8Iterator) Int8Iterator
Int8Invert unrolls items and make inverting iterator based on them.
func PriorInt8EnumIterator ¶ added in v0.0.4
func PriorInt8EnumIterator(comparer Int8EnumComparer, itemList ...Int8Iterator) Int8Iterator
PriorInt8EnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorInt8Iterator ¶ added in v0.0.2
func PriorInt8Iterator(comparer Int8Comparer, itemList ...Int8Iterator) Int8Iterator
PriorInt8Iterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperInt8Iterator ¶
func SuperInt8Iterator(itemList ...Int8Iterator) Int8Iterator
SuperInt8Iterator combines all iterators to one.
type Int8RangeIterator ¶
type Int8RangeIterator interface { // Range should iterate over items. Range(...Int8Handler) error }
Int8RangeIterator is an iterator over items.
func MakeInt8RangeIterator ¶
func MakeInt8RangeIterator(maker Int8IterMaker) Int8RangeIterator
MakeInt8RangeIterator constructs an instance implementing Int8RangeIterator based on Int8IterMaker.
func ToInt8RangeIterator ¶
func ToInt8RangeIterator(iter Int8Iterator) Int8RangeIterator
ToInt8RangeIterator constructs an instance implementing Int8RangeIterator based on Int8Iterator.
type Int8Slice ¶
type Int8Slice []int8
Int8Slice is a slice of int8.
func Int8Unroll ¶
func Int8Unroll(items Int8Iterator) Int8Slice
Int8Unroll unrolls items to slice of int8.
func (Int8Slice) MakeIter ¶
func (s Int8Slice) MakeIter() Int8Iterator
MakeIter returns a new instance of Int8Iterator to iterate over it. It returns EmptyInt8Iterator if the error is not nil.
type Int8SliceIterator ¶
type Int8SliceIterator struct {
// contains filtered or unexported fields
}
Int8SliceIterator is an iterator based on a slice of int8.
func NewInt8SliceIterator ¶ added in v0.0.2
func NewInt8SliceIterator(slice []int8) *Int8SliceIterator
NewInt8SliceIterator returns a new instance of Int8SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Int8Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (Int8SliceIterator) Err ¶
func (Int8SliceIterator) Err() error
Err contains first met error while Next.
func (Int8SliceIterator) HasNext ¶
func (it Int8SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*Int8SliceIterator) Next ¶
func (it *Int8SliceIterator) Next() int8
Next returns next item in the iterator. It should be invoked after check HasNext.
type IntChecker ¶
type IntChecker interface { // Check should check an item type of int for some condition. // It is suggested to return EndOfIntIterator to stop iteration. Check(int) (bool, error) }
IntChecker is an object checking an item type of int for some condition.
var ( // AlwaysIntCheckTrue always returns true and empty error. AlwaysIntCheckTrue IntChecker = IntCheck( func(item int) (bool, error) { return true, nil }) // AlwaysIntCheckFalse always returns false and empty error. AlwaysIntCheckFalse IntChecker = IntCheck( func(item int) (bool, error) { return false, nil }) )
func AllInt ¶
func AllInt(checkers ...IntChecker) IntChecker
AllInt combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyInt ¶
func AnyInt(checkers ...IntChecker) IntChecker
AnyInt combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotInt ¶
func NotInt(checker IntChecker) IntChecker
NotInt do an inversion for checker result. It is returns AlwaysIntCheckTrue if checker is nil.
type IntCompare ¶ added in v0.0.2
IntCompare is a shortcut implementation of IntEnumComparer based on a function.
func (IntCompare) IsLess ¶ added in v0.0.2
func (c IntCompare) IsLess(lhs, rhs int) bool
IsLess is true if lhs is less than rhs.
type IntComparer ¶ added in v0.0.2
type IntComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs int) bool }
IntEnumComparer is a strategy to compare two types.
var IntAlwaysLess IntComparer = IntCompare(func(_, _ int) bool { return true })
EnumIntAlwaysLess is an implementation of IntEnumComparer returning always true.
type IntConvert ¶
IntConvert is a shortcut implementation of IntConverter based on a function.
type IntConverter ¶
type IntConverter interface { // Convert should convert an item type of int into another item of int. // It is suggested to return EndOfIntIterator to stop iteration. Convert(int) (int, error) }
IntConverter is an object converting an item type of int.
var NoIntConvert IntConverter = IntConvert( func(item int) (int, error) { return item, nil })
NoIntConvert does nothing with item, just returns it as is.
func IntConverterSeries ¶
func IntConverterSeries(converters ...IntConverter) IntConverter
IntConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type IntEnumCheck ¶
IntEnumCheck is a shortcut implementation of IntEnumChecker based on a function.
type IntEnumChecker ¶
type IntEnumChecker interface { // Check checks an item type of int and its ordering number for some condition. // It is suggested to return EndOfIntIterator to stop iteration. Check(int, int) (bool, error) }
IntEnumChecker is an object checking an item type of int and its ordering number in for some condition.
func EnumAllInt ¶
func EnumAllInt(checkers ...IntEnumChecker) IntEnumChecker
EnumAllInt combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyInt ¶
func EnumAnyInt(checkers ...IntEnumChecker) IntEnumChecker
EnumAnyInt combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromIntChecker ¶
func EnumFromIntChecker(checker IntChecker) IntEnumChecker
EnumFromIntChecker adapts checker type of IntChecker to the interface IntEnumChecker. If checker is nil it is return based on AlwaysIntCheckFalse enum checker.
func EnumNotInt ¶
func EnumNotInt(checker IntEnumChecker) IntEnumChecker
EnumNotInt do an inversion for checker result. It is returns AlwaysIntEnumCheckTrue if checker is nil.
type IntEnumCompare ¶ added in v0.0.4
IntEnumCompare is a shortcut implementation of IntEnumComparer based on a function.
type IntEnumComparer ¶ added in v0.0.4
type IntEnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs int, nRHS int, rhs int) bool }
IntEnumComparer is a strategy to compare two types and their order numbers.
var EnumIntAlwaysLess IntEnumComparer = IntEnumCompare( func(_ int, _ int, _ int, _ int) bool { return true })
EnumIntAlwaysLess is an implementation of IntEnumComparer returning always true.
type IntEnumConvert ¶
IntEnumConvert is a shortcut implementation of IntEnumConverter based on a function.
type IntEnumConverter ¶
type IntEnumConverter interface { // Convert should convert an item type of int into another item of int. // It is suggested to return EndOfIntIterator to stop iteration. Convert(n int, val int) (int, error) }
IntEnumConverter is an object converting an item type of int and its ordering number.
var NoIntEnumConvert IntEnumConverter = IntEnumConvert( func(_ int, item int) (int, error) { return item, nil })
NoIntEnumConvert does nothing with item, just returns it as is.
func EnumFromIntConverter ¶
func EnumFromIntConverter(converter IntConverter) IntEnumConverter
EnumFromIntConverter adapts checker type of IntConverter to the interface IntEnumConverter. If converter is nil it is return based on NoIntConvert enum checker.
func EnumIntConverterSeries ¶
func EnumIntConverterSeries(converters ...IntEnumConverter) IntEnumConverter
EnumIntConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type IntEnumHandle ¶
IntEnumHandle is a shortcut implementation of IntEnumHandler based on a function.
type IntEnumHandler ¶
type IntEnumHandler interface { // Handle should do something with item of int and its ordered number. // It is suggested to return EndOfIntIterator to stop iteration. Handle(int, int) error }
IntEnumHandler is an object handling an item type of int and its ordered number.
func IntEnumHandlerSeries ¶
func IntEnumHandlerSeries(handlers ...IntEnumHandler) IntEnumHandler
IntEnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type IntEnumIterator ¶
type IntEnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...IntEnumHandler) error }
IntEnumIterator is an iterator over items and their ordering numbers.
func MakeIntEnumIterator ¶
func MakeIntEnumIterator(maker IntIterMaker) IntEnumIterator
MakeIntEnumIterator constructs an instance implementing IntEnumIterator based on IntIterMaker.
func ToIntEnumIterator ¶
func ToIntEnumIterator(iter IntIterator) IntEnumIterator
ToIntEnumIterator constructs an instance implementing IntEnumIterator based on IntIterator.
type IntHandler ¶
type IntHandler interface { // Handle should do something with item of int. // It is suggested to return EndOfIntIterator to stop iteration. Handle(int) error }
IntHandler is an object handling an item type of int.
var IntDoNothing IntHandler = IntHandle(func(_ int) error { return nil })
IntDoNothing does nothing.
func IntHandlerSeries ¶
func IntHandlerSeries(handlers ...IntHandler) IntHandler
IntHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type IntIterMaker ¶
type IntIterMaker interface { // MakeIter should return a new instance of IntIterator to iterate over it. MakeIter() IntIterator }
IntIterMaker is a maker of IntIterator.
var MakeNoIntIter IntIterMaker = MakeIntIter( func() IntIterator { return EmptyIntIterator })
MakeNoIntIter is a zero value for IntIterMaker. It always returns EmptyIntIterator and an empty error.
type IntIterator ¶
type IntIterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() int // Err contains first met error while Next. Err() error }
IntIterator is an iterator over items type of int.
var EmptyIntIterator IntIterator = emptyIntIterator{}
EmptyIntIterator is a zero value for IntIterator. It is not contains any item to iterate over it.
func IntConverting ¶
func IntConverting(items IntIterator, converters ...IntConverter) IntIterator
IntConverting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func IntDoingUntil ¶
func IntDoingUntil(items IntIterator, untilList ...IntChecker) IntIterator
IntDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func IntEnumConverting ¶
func IntEnumConverting(items IntIterator, converters ...IntEnumConverter) IntIterator
IntEnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func IntEnumDoingUntil ¶
func IntEnumDoingUntil(items IntIterator, untilList ...IntEnumChecker) IntIterator
IntEnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func IntEnumFiltering ¶
func IntEnumFiltering(items IntIterator, filters ...IntEnumChecker) IntIterator
IntEnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func IntEnumHandling ¶
func IntEnumHandling(items IntIterator, handlers ...IntEnumHandler) IntIterator
IntEnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func IntFiltering ¶
func IntFiltering(items IntIterator, filters ...IntChecker) IntIterator
IntFiltering sets filter while iterating over items. If filters is empty, so all items will return.
func IntGettingBatch ¶
func IntGettingBatch(items IntIterator, batchSize int) IntIterator
IntGettingBatch returns the next batch from items.
func IntHandling ¶
func IntHandling(items IntIterator, handlers ...IntHandler) IntIterator
IntHandling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func IntInvert ¶
func IntInvert(items IntIterator) IntIterator
IntInvert unrolls items and make inverting iterator based on them.
func PriorIntEnumIterator ¶ added in v0.0.4
func PriorIntEnumIterator(comparer IntEnumComparer, itemList ...IntIterator) IntIterator
PriorIntEnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorIntIterator ¶ added in v0.0.2
func PriorIntIterator(comparer IntComparer, itemList ...IntIterator) IntIterator
PriorIntIterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperIntIterator ¶
func SuperIntIterator(itemList ...IntIterator) IntIterator
SuperIntIterator combines all iterators to one.
type IntRangeIterator ¶
type IntRangeIterator interface { // Range should iterate over items. Range(...IntHandler) error }
IntRangeIterator is an iterator over items.
func MakeIntRangeIterator ¶
func MakeIntRangeIterator(maker IntIterMaker) IntRangeIterator
MakeIntRangeIterator constructs an instance implementing IntRangeIterator based on IntIterMaker.
func ToIntRangeIterator ¶
func ToIntRangeIterator(iter IntIterator) IntRangeIterator
ToIntRangeIterator constructs an instance implementing IntRangeIterator based on IntIterator.
type IntSlice ¶
type IntSlice []int
IntSlice is a slice of int.
func IntUnroll ¶
func IntUnroll(items IntIterator) IntSlice
IntUnroll unrolls items to slice of int.
func (IntSlice) MakeIter ¶
func (s IntSlice) MakeIter() IntIterator
MakeIter returns a new instance of IntIterator to iterate over it. It returns EmptyIntIterator if the error is not nil.
type IntSliceIterator ¶
type IntSliceIterator struct {
// contains filtered or unexported fields
}
IntSliceIterator is an iterator based on a slice of int.
func NewIntSliceIterator ¶ added in v0.0.2
func NewIntSliceIterator(slice []int) *IntSliceIterator
NewIntSliceIterator returns a new instance of IntSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use IntUnroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (IntSliceIterator) Err ¶
func (IntSliceIterator) Err() error
Err contains first met error while Next.
func (IntSliceIterator) HasNext ¶
func (it IntSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*IntSliceIterator) Next ¶
func (it *IntSliceIterator) Next() int
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingByteSlice ¶
type InvertingByteSlice []byte
ByteSlice is a slice of byte which can make inverting iterator.
func (InvertingByteSlice) MakeIter ¶
func (s InvertingByteSlice) MakeIter() ByteIterator
MakeIter returns a new instance of ByteIterator to iterate over it. It returns EmptyByteIterator if the error is not nil.
type InvertingByteSliceIterator ¶
type InvertingByteSliceIterator struct {
// contains filtered or unexported fields
}
ByteSliceIterator is an iterator based on a slice of byte and doing iteration in back direction.
func NewInvertingByteSliceIterator ¶ added in v0.0.2
func NewInvertingByteSliceIterator(slice []byte) *InvertingByteSliceIterator
NewInvertingByteSliceIterator returns a new instance of InvertingByteSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingByteSlice(ByteUnroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingByteSliceIterator) Err ¶
func (InvertingByteSliceIterator) Err() error
Err contains first met error while Next.
func (InvertingByteSliceIterator) HasNext ¶
func (it InvertingByteSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingByteSliceIterator) Next ¶
func (it *InvertingByteSliceIterator) Next() byte
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingInt16Slice ¶
type InvertingInt16Slice []int16
Int16Slice is a slice of int16 which can make inverting iterator.
func (InvertingInt16Slice) MakeIter ¶
func (s InvertingInt16Slice) MakeIter() Int16Iterator
MakeIter returns a new instance of Int16Iterator to iterate over it. It returns EmptyInt16Iterator if the error is not nil.
type InvertingInt16SliceIterator ¶
type InvertingInt16SliceIterator struct {
// contains filtered or unexported fields
}
Int16SliceIterator is an iterator based on a slice of int16 and doing iteration in back direction.
func NewInvertingInt16SliceIterator ¶ added in v0.0.2
func NewInvertingInt16SliceIterator(slice []int16) *InvertingInt16SliceIterator
NewInvertingInt16SliceIterator returns a new instance of InvertingInt16SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingInt16Slice(Int16Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingInt16SliceIterator) Err ¶
func (InvertingInt16SliceIterator) Err() error
Err contains first met error while Next.
func (InvertingInt16SliceIterator) HasNext ¶
func (it InvertingInt16SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingInt16SliceIterator) Next ¶
func (it *InvertingInt16SliceIterator) Next() int16
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingInt32Slice ¶
type InvertingInt32Slice []int32
Int32Slice is a slice of int32 which can make inverting iterator.
func (InvertingInt32Slice) MakeIter ¶
func (s InvertingInt32Slice) MakeIter() Int32Iterator
MakeIter returns a new instance of Int32Iterator to iterate over it. It returns EmptyInt32Iterator if the error is not nil.
type InvertingInt32SliceIterator ¶
type InvertingInt32SliceIterator struct {
// contains filtered or unexported fields
}
Int32SliceIterator is an iterator based on a slice of int32 and doing iteration in back direction.
func NewInvertingInt32SliceIterator ¶ added in v0.0.2
func NewInvertingInt32SliceIterator(slice []int32) *InvertingInt32SliceIterator
NewInvertingInt32SliceIterator returns a new instance of InvertingInt32SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingInt32Slice(Int32Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingInt32SliceIterator) Err ¶
func (InvertingInt32SliceIterator) Err() error
Err contains first met error while Next.
func (InvertingInt32SliceIterator) HasNext ¶
func (it InvertingInt32SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingInt32SliceIterator) Next ¶
func (it *InvertingInt32SliceIterator) Next() int32
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingInt64Slice ¶
type InvertingInt64Slice []int64
Int64Slice is a slice of int64 which can make inverting iterator.
func (InvertingInt64Slice) MakeIter ¶
func (s InvertingInt64Slice) MakeIter() Int64Iterator
MakeIter returns a new instance of Int64Iterator to iterate over it. It returns EmptyInt64Iterator if the error is not nil.
type InvertingInt64SliceIterator ¶
type InvertingInt64SliceIterator struct {
// contains filtered or unexported fields
}
Int64SliceIterator is an iterator based on a slice of int64 and doing iteration in back direction.
func NewInvertingInt64SliceIterator ¶ added in v0.0.2
func NewInvertingInt64SliceIterator(slice []int64) *InvertingInt64SliceIterator
NewInvertingInt64SliceIterator returns a new instance of InvertingInt64SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingInt64Slice(Int64Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingInt64SliceIterator) Err ¶
func (InvertingInt64SliceIterator) Err() error
Err contains first met error while Next.
func (InvertingInt64SliceIterator) HasNext ¶
func (it InvertingInt64SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingInt64SliceIterator) Next ¶
func (it *InvertingInt64SliceIterator) Next() int64
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingInt8Slice ¶
type InvertingInt8Slice []int8
Int8Slice is a slice of int8 which can make inverting iterator.
func (InvertingInt8Slice) MakeIter ¶
func (s InvertingInt8Slice) MakeIter() Int8Iterator
MakeIter returns a new instance of Int8Iterator to iterate over it. It returns EmptyInt8Iterator if the error is not nil.
type InvertingInt8SliceIterator ¶
type InvertingInt8SliceIterator struct {
// contains filtered or unexported fields
}
Int8SliceIterator is an iterator based on a slice of int8 and doing iteration in back direction.
func NewInvertingInt8SliceIterator ¶ added in v0.0.2
func NewInvertingInt8SliceIterator(slice []int8) *InvertingInt8SliceIterator
NewInvertingInt8SliceIterator returns a new instance of InvertingInt8SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingInt8Slice(Int8Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingInt8SliceIterator) Err ¶
func (InvertingInt8SliceIterator) Err() error
Err contains first met error while Next.
func (InvertingInt8SliceIterator) HasNext ¶
func (it InvertingInt8SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingInt8SliceIterator) Next ¶
func (it *InvertingInt8SliceIterator) Next() int8
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingIntSlice ¶
type InvertingIntSlice []int
IntSlice is a slice of int which can make inverting iterator.
func (InvertingIntSlice) MakeIter ¶
func (s InvertingIntSlice) MakeIter() IntIterator
MakeIter returns a new instance of IntIterator to iterate over it. It returns EmptyIntIterator if the error is not nil.
type InvertingIntSliceIterator ¶
type InvertingIntSliceIterator struct {
// contains filtered or unexported fields
}
IntSliceIterator is an iterator based on a slice of int and doing iteration in back direction.
func NewInvertingIntSliceIterator ¶ added in v0.0.2
func NewInvertingIntSliceIterator(slice []int) *InvertingIntSliceIterator
NewInvertingIntSliceIterator returns a new instance of InvertingIntSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingIntSlice(IntUnroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingIntSliceIterator) Err ¶
func (InvertingIntSliceIterator) Err() error
Err contains first met error while Next.
func (InvertingIntSliceIterator) HasNext ¶
func (it InvertingIntSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingIntSliceIterator) Next ¶
func (it *InvertingIntSliceIterator) Next() int
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingRuneSlice ¶
type InvertingRuneSlice []rune
RuneSlice is a slice of rune which can make inverting iterator.
func (InvertingRuneSlice) MakeIter ¶
func (s InvertingRuneSlice) MakeIter() RuneIterator
MakeIter returns a new instance of RuneIterator to iterate over it. It returns EmptyRuneIterator if the error is not nil.
type InvertingRuneSliceIterator ¶
type InvertingRuneSliceIterator struct {
// contains filtered or unexported fields
}
RuneSliceIterator is an iterator based on a slice of rune and doing iteration in back direction.
func NewInvertingRuneSliceIterator ¶ added in v0.0.2
func NewInvertingRuneSliceIterator(slice []rune) *InvertingRuneSliceIterator
NewInvertingRuneSliceIterator returns a new instance of InvertingRuneSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingRuneSlice(RuneUnroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingRuneSliceIterator) Err ¶
func (InvertingRuneSliceIterator) Err() error
Err contains first met error while Next.
func (InvertingRuneSliceIterator) HasNext ¶
func (it InvertingRuneSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingRuneSliceIterator) Next ¶
func (it *InvertingRuneSliceIterator) Next() rune
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingSlice ¶
type InvertingSlice []interface{}
Slice is a slice of interface{} which can make inverting iterator.
func (InvertingSlice) MakeIter ¶
func (s InvertingSlice) MakeIter() Iterator
MakeIter returns a new instance of Iterator to iterate over it. It returns EmptyIterator if the error is not nil.
type InvertingSliceIterator ¶
type InvertingSliceIterator struct {
// contains filtered or unexported fields
}
SliceIterator is an iterator based on a slice of interface{} and doing iteration in back direction.
func NewInvertingSliceIterator ¶ added in v0.0.2
func NewInvertingSliceIterator(slice []interface{}) *InvertingSliceIterator
NewInvertingSliceIterator returns a new instance of InvertingSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingSlice(Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingSliceIterator) Err ¶
func (InvertingSliceIterator) Err() error
Err contains first met error while Next.
func (InvertingSliceIterator) HasNext ¶
func (it InvertingSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingSliceIterator) Next ¶
func (it *InvertingSliceIterator) Next() interface{}
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingStringSlice ¶
type InvertingStringSlice []string
StringSlice is a slice of string which can make inverting iterator.
func (InvertingStringSlice) MakeIter ¶
func (s InvertingStringSlice) MakeIter() StringIterator
MakeIter returns a new instance of StringIterator to iterate over it. It returns EmptyStringIterator if the error is not nil.
type InvertingStringSliceIterator ¶
type InvertingStringSliceIterator struct {
// contains filtered or unexported fields
}
StringSliceIterator is an iterator based on a slice of string and doing iteration in back direction.
func NewInvertingStringSliceIterator ¶ added in v0.0.2
func NewInvertingStringSliceIterator(slice []string) *InvertingStringSliceIterator
NewInvertingStringSliceIterator returns a new instance of InvertingStringSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingStringSlice(StringUnroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingStringSliceIterator) Err ¶
func (InvertingStringSliceIterator) Err() error
Err contains first met error while Next.
func (InvertingStringSliceIterator) HasNext ¶
func (it InvertingStringSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingStringSliceIterator) Next ¶
func (it *InvertingStringSliceIterator) Next() string
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingUint16Slice ¶
type InvertingUint16Slice []uint16
Uint16Slice is a slice of uint16 which can make inverting iterator.
func (InvertingUint16Slice) MakeIter ¶
func (s InvertingUint16Slice) MakeIter() Uint16Iterator
MakeIter returns a new instance of Uint16Iterator to iterate over it. It returns EmptyUint16Iterator if the error is not nil.
type InvertingUint16SliceIterator ¶
type InvertingUint16SliceIterator struct {
// contains filtered or unexported fields
}
Uint16SliceIterator is an iterator based on a slice of uint16 and doing iteration in back direction.
func NewInvertingUint16SliceIterator ¶ added in v0.0.2
func NewInvertingUint16SliceIterator(slice []uint16) *InvertingUint16SliceIterator
NewInvertingUint16SliceIterator returns a new instance of InvertingUint16SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingUint16Slice(Uint16Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingUint16SliceIterator) Err ¶
func (InvertingUint16SliceIterator) Err() error
Err contains first met error while Next.
func (InvertingUint16SliceIterator) HasNext ¶
func (it InvertingUint16SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingUint16SliceIterator) Next ¶
func (it *InvertingUint16SliceIterator) Next() uint16
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingUint32Slice ¶
type InvertingUint32Slice []uint32
Uint32Slice is a slice of uint32 which can make inverting iterator.
func (InvertingUint32Slice) MakeIter ¶
func (s InvertingUint32Slice) MakeIter() Uint32Iterator
MakeIter returns a new instance of Uint32Iterator to iterate over it. It returns EmptyUint32Iterator if the error is not nil.
type InvertingUint32SliceIterator ¶
type InvertingUint32SliceIterator struct {
// contains filtered or unexported fields
}
Uint32SliceIterator is an iterator based on a slice of uint32 and doing iteration in back direction.
func NewInvertingUint32SliceIterator ¶ added in v0.0.2
func NewInvertingUint32SliceIterator(slice []uint32) *InvertingUint32SliceIterator
NewInvertingUint32SliceIterator returns a new instance of InvertingUint32SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingUint32Slice(Uint32Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingUint32SliceIterator) Err ¶
func (InvertingUint32SliceIterator) Err() error
Err contains first met error while Next.
func (InvertingUint32SliceIterator) HasNext ¶
func (it InvertingUint32SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingUint32SliceIterator) Next ¶
func (it *InvertingUint32SliceIterator) Next() uint32
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingUint64Slice ¶
type InvertingUint64Slice []uint64
Uint64Slice is a slice of uint64 which can make inverting iterator.
func (InvertingUint64Slice) MakeIter ¶
func (s InvertingUint64Slice) MakeIter() Uint64Iterator
MakeIter returns a new instance of Uint64Iterator to iterate over it. It returns EmptyUint64Iterator if the error is not nil.
type InvertingUint64SliceIterator ¶
type InvertingUint64SliceIterator struct {
// contains filtered or unexported fields
}
Uint64SliceIterator is an iterator based on a slice of uint64 and doing iteration in back direction.
func NewInvertingUint64SliceIterator ¶ added in v0.0.2
func NewInvertingUint64SliceIterator(slice []uint64) *InvertingUint64SliceIterator
NewInvertingUint64SliceIterator returns a new instance of InvertingUint64SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingUint64Slice(Uint64Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingUint64SliceIterator) Err ¶
func (InvertingUint64SliceIterator) Err() error
Err contains first met error while Next.
func (InvertingUint64SliceIterator) HasNext ¶
func (it InvertingUint64SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingUint64SliceIterator) Next ¶
func (it *InvertingUint64SliceIterator) Next() uint64
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingUint8Slice ¶
type InvertingUint8Slice []uint8
Uint8Slice is a slice of uint8 which can make inverting iterator.
func (InvertingUint8Slice) MakeIter ¶
func (s InvertingUint8Slice) MakeIter() Uint8Iterator
MakeIter returns a new instance of Uint8Iterator to iterate over it. It returns EmptyUint8Iterator if the error is not nil.
type InvertingUint8SliceIterator ¶
type InvertingUint8SliceIterator struct {
// contains filtered or unexported fields
}
Uint8SliceIterator is an iterator based on a slice of uint8 and doing iteration in back direction.
func NewInvertingUint8SliceIterator ¶ added in v0.0.2
func NewInvertingUint8SliceIterator(slice []uint8) *InvertingUint8SliceIterator
NewInvertingUint8SliceIterator returns a new instance of InvertingUint8SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingUint8Slice(Uint8Unroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingUint8SliceIterator) Err ¶
func (InvertingUint8SliceIterator) Err() error
Err contains first met error while Next.
func (InvertingUint8SliceIterator) HasNext ¶
func (it InvertingUint8SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingUint8SliceIterator) Next ¶
func (it *InvertingUint8SliceIterator) Next() uint8
Next returns next item in the iterator. It should be invoked after check HasNext.
type InvertingUintSlice ¶
type InvertingUintSlice []uint
UintSlice is a slice of uint which can make inverting iterator.
func (InvertingUintSlice) MakeIter ¶
func (s InvertingUintSlice) MakeIter() UintIterator
MakeIter returns a new instance of UintIterator to iterate over it. It returns EmptyUintIterator if the error is not nil.
type InvertingUintSliceIterator ¶
type InvertingUintSliceIterator struct {
// contains filtered or unexported fields
}
UintSliceIterator is an iterator based on a slice of uint and doing iteration in back direction.
func NewInvertingUintSliceIterator ¶ added in v0.0.2
func NewInvertingUintSliceIterator(slice []uint) *InvertingUintSliceIterator
NewInvertingUintSliceIterator returns a new instance of InvertingUintSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use InvertingUintSlice(UintUnroll(slice)).MakeIter() instead of to iterate over copies of item in the items.
func (InvertingUintSliceIterator) Err ¶
func (InvertingUintSliceIterator) Err() error
Err contains first met error while Next.
func (InvertingUintSliceIterator) HasNext ¶
func (it InvertingUintSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*InvertingUintSliceIterator) Next ¶
func (it *InvertingUintSliceIterator) Next() uint
Next returns next item in the iterator. It should be invoked after check HasNext.
type IterMaker ¶
type IterMaker interface { // MakeIter should return a new instance of Iterator to iterate over it. MakeIter() Iterator }
IterMaker is a maker of Iterator.
var MakeNoIter IterMaker = MakeIter( func() Iterator { return EmptyIterator })
MakeNoIter is a zero value for IterMaker. It always returns EmptyIterator and an empty error.
type Iterator ¶
type Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() interface{} // Err contains first met error while Next. Err() error }
Iterator is an iterator over items type of interface{}.
var EmptyIterator Iterator = emptyIterator{}
EmptyIterator is a zero value for Iterator. It is not contains any item to iterate over it.
func Converting ¶
Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func DoingUntil ¶
DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func EnumConverting ¶
func EnumConverting(items Iterator, converters ...EnumConverter) Iterator
EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func EnumDoingUntil ¶
func EnumDoingUntil(items Iterator, untilList ...EnumChecker) Iterator
EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func EnumFiltering ¶
func EnumFiltering(items Iterator, filters ...EnumChecker) Iterator
EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func EnumHandling ¶
func EnumHandling(items Iterator, handlers ...EnumHandler) Iterator
EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Filtering ¶
Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func GettingBatch ¶
GettingBatch returns the next batch from items.
func Handling ¶
Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func PriorEnumIterator ¶ added in v0.0.4
func PriorEnumIterator(comparer EnumComparer, itemList ...Iterator) Iterator
PriorEnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorIterator ¶ added in v0.0.2
PriorIterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperIterator ¶
SuperIterator combines all iterators to one.
type MakeByteIter ¶
type MakeByteIter func() ByteIterator
MakeByteIter is a shortcut implementation of ByteIterator based on a function.
func (MakeByteIter) MakeIter ¶
func (m MakeByteIter) MakeIter() ByteIterator
MakeIter returns a new instance of ByteIterator to iterate over it.
type MakeInt16Iter ¶
type MakeInt16Iter func() Int16Iterator
MakeInt16Iter is a shortcut implementation of Int16Iterator based on a function.
func (MakeInt16Iter) MakeIter ¶
func (m MakeInt16Iter) MakeIter() Int16Iterator
MakeIter returns a new instance of Int16Iterator to iterate over it.
type MakeInt32Iter ¶
type MakeInt32Iter func() Int32Iterator
MakeInt32Iter is a shortcut implementation of Int32Iterator based on a function.
func (MakeInt32Iter) MakeIter ¶
func (m MakeInt32Iter) MakeIter() Int32Iterator
MakeIter returns a new instance of Int32Iterator to iterate over it.
type MakeInt64Iter ¶
type MakeInt64Iter func() Int64Iterator
MakeInt64Iter is a shortcut implementation of Int64Iterator based on a function.
func (MakeInt64Iter) MakeIter ¶
func (m MakeInt64Iter) MakeIter() Int64Iterator
MakeIter returns a new instance of Int64Iterator to iterate over it.
type MakeInt8Iter ¶
type MakeInt8Iter func() Int8Iterator
MakeInt8Iter is a shortcut implementation of Int8Iterator based on a function.
func (MakeInt8Iter) MakeIter ¶
func (m MakeInt8Iter) MakeIter() Int8Iterator
MakeIter returns a new instance of Int8Iterator to iterate over it.
type MakeIntIter ¶
type MakeIntIter func() IntIterator
MakeIntIter is a shortcut implementation of IntIterator based on a function.
func (MakeIntIter) MakeIter ¶
func (m MakeIntIter) MakeIter() IntIterator
MakeIter returns a new instance of IntIterator to iterate over it.
type MakeIter ¶
type MakeIter func() Iterator
MakeIter is a shortcut implementation of Iterator based on a function.
type MakeRuneIter ¶
type MakeRuneIter func() RuneIterator
MakeRuneIter is a shortcut implementation of RuneIterator based on a function.
func (MakeRuneIter) MakeIter ¶
func (m MakeRuneIter) MakeIter() RuneIterator
MakeIter returns a new instance of RuneIterator to iterate over it.
type MakeStringIter ¶
type MakeStringIter func() StringIterator
MakeStringIter is a shortcut implementation of StringIterator based on a function.
func (MakeStringIter) MakeIter ¶
func (m MakeStringIter) MakeIter() StringIterator
MakeIter returns a new instance of StringIterator to iterate over it.
type MakeUint16Iter ¶
type MakeUint16Iter func() Uint16Iterator
MakeUint16Iter is a shortcut implementation of Uint16Iterator based on a function.
func (MakeUint16Iter) MakeIter ¶
func (m MakeUint16Iter) MakeIter() Uint16Iterator
MakeIter returns a new instance of Uint16Iterator to iterate over it.
type MakeUint32Iter ¶
type MakeUint32Iter func() Uint32Iterator
MakeUint32Iter is a shortcut implementation of Uint32Iterator based on a function.
func (MakeUint32Iter) MakeIter ¶
func (m MakeUint32Iter) MakeIter() Uint32Iterator
MakeIter returns a new instance of Uint32Iterator to iterate over it.
type MakeUint64Iter ¶
type MakeUint64Iter func() Uint64Iterator
MakeUint64Iter is a shortcut implementation of Uint64Iterator based on a function.
func (MakeUint64Iter) MakeIter ¶
func (m MakeUint64Iter) MakeIter() Uint64Iterator
MakeIter returns a new instance of Uint64Iterator to iterate over it.
type MakeUint8Iter ¶
type MakeUint8Iter func() Uint8Iterator
MakeUint8Iter is a shortcut implementation of Uint8Iterator based on a function.
func (MakeUint8Iter) MakeIter ¶
func (m MakeUint8Iter) MakeIter() Uint8Iterator
MakeIter returns a new instance of Uint8Iterator to iterate over it.
type MakeUintIter ¶
type MakeUintIter func() UintIterator
MakeUintIter is a shortcut implementation of UintIterator based on a function.
func (MakeUintIter) MakeIter ¶
func (m MakeUintIter) MakeIter() UintIterator
MakeIter returns a new instance of UintIterator to iterate over it.
type RangeIterator ¶
RangeIterator is an iterator over items.
func MakeRangeIterator ¶
func MakeRangeIterator(maker IterMaker) RangeIterator
MakeRangeIterator constructs an instance implementing RangeIterator based on IterMaker.
func ToRangeIterator ¶
func ToRangeIterator(iter Iterator) RangeIterator
ToRangeIterator constructs an instance implementing RangeIterator based on Iterator.
type RuneChecker ¶
type RuneChecker interface { // Check should check an item type of rune for some condition. // It is suggested to return EndOfRuneIterator to stop iteration. Check(rune) (bool, error) }
RuneChecker is an object checking an item type of rune for some condition.
var ( // AlwaysRuneCheckTrue always returns true and empty error. AlwaysRuneCheckTrue RuneChecker = RuneCheck( func(item rune) (bool, error) { return true, nil }) // AlwaysRuneCheckFalse always returns false and empty error. AlwaysRuneCheckFalse RuneChecker = RuneCheck( func(item rune) (bool, error) { return false, nil }) )
func AllRune ¶
func AllRune(checkers ...RuneChecker) RuneChecker
AllRune combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyRune ¶
func AnyRune(checkers ...RuneChecker) RuneChecker
AnyRune combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotRune ¶
func NotRune(checker RuneChecker) RuneChecker
NotRune do an inversion for checker result. It is returns AlwaysRuneCheckTrue if checker is nil.
type RuneCompare ¶ added in v0.0.2
RuneCompare is a shortcut implementation of RuneEnumComparer based on a function.
func (RuneCompare) IsLess ¶ added in v0.0.2
func (c RuneCompare) IsLess(lhs, rhs rune) bool
IsLess is true if lhs is less than rhs.
type RuneComparer ¶ added in v0.0.2
type RuneComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs rune) bool }
RuneEnumComparer is a strategy to compare two types.
var RuneAlwaysLess RuneComparer = RuneCompare(func(_, _ rune) bool { return true })
EnumRuneAlwaysLess is an implementation of RuneEnumComparer returning always true.
type RuneConvert ¶
RuneConvert is a shortcut implementation of RuneConverter based on a function.
type RuneConverter ¶
type RuneConverter interface { // Convert should convert an item type of rune into another item of rune. // It is suggested to return EndOfRuneIterator to stop iteration. Convert(rune) (rune, error) }
RuneConverter is an object converting an item type of rune.
var NoRuneConvert RuneConverter = RuneConvert( func(item rune) (rune, error) { return item, nil })
NoRuneConvert does nothing with item, just returns it as is.
func RuneConverterSeries ¶
func RuneConverterSeries(converters ...RuneConverter) RuneConverter
RuneConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type RuneEnumCheck ¶
RuneEnumCheck is a shortcut implementation of RuneEnumChecker based on a function.
type RuneEnumChecker ¶
type RuneEnumChecker interface { // Check checks an item type of rune and its ordering number for some condition. // It is suggested to return EndOfRuneIterator to stop iteration. Check(int, rune) (bool, error) }
RuneEnumChecker is an object checking an item type of rune and its ordering number in for some condition.
func EnumAllRune ¶
func EnumAllRune(checkers ...RuneEnumChecker) RuneEnumChecker
EnumAllRune combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyRune ¶
func EnumAnyRune(checkers ...RuneEnumChecker) RuneEnumChecker
EnumAnyRune combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromRuneChecker ¶
func EnumFromRuneChecker(checker RuneChecker) RuneEnumChecker
EnumFromRuneChecker adapts checker type of RuneChecker to the interface RuneEnumChecker. If checker is nil it is return based on AlwaysRuneCheckFalse enum checker.
func EnumNotRune ¶
func EnumNotRune(checker RuneEnumChecker) RuneEnumChecker
EnumNotRune do an inversion for checker result. It is returns AlwaysRuneEnumCheckTrue if checker is nil.
type RuneEnumCompare ¶ added in v0.0.4
RuneEnumCompare is a shortcut implementation of RuneEnumComparer based on a function.
type RuneEnumComparer ¶ added in v0.0.4
type RuneEnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs rune, nRHS int, rhs rune) bool }
RuneEnumComparer is a strategy to compare two types and their order numbers.
var EnumRuneAlwaysLess RuneEnumComparer = RuneEnumCompare( func(_ int, _ rune, _ int, _ rune) bool { return true })
EnumRuneAlwaysLess is an implementation of RuneEnumComparer returning always true.
type RuneEnumConvert ¶
RuneEnumConvert is a shortcut implementation of RuneEnumConverter based on a function.
type RuneEnumConverter ¶
type RuneEnumConverter interface { // Convert should convert an item type of rune into another item of rune. // It is suggested to return EndOfRuneIterator to stop iteration. Convert(n int, val rune) (rune, error) }
RuneEnumConverter is an object converting an item type of rune and its ordering number.
var NoRuneEnumConvert RuneEnumConverter = RuneEnumConvert( func(_ int, item rune) (rune, error) { return item, nil })
NoRuneEnumConvert does nothing with item, just returns it as is.
func EnumFromRuneConverter ¶
func EnumFromRuneConverter(converter RuneConverter) RuneEnumConverter
EnumFromRuneConverter adapts checker type of RuneConverter to the interface RuneEnumConverter. If converter is nil it is return based on NoRuneConvert enum checker.
func EnumRuneConverterSeries ¶
func EnumRuneConverterSeries(converters ...RuneEnumConverter) RuneEnumConverter
EnumRuneConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type RuneEnumHandle ¶
RuneEnumHandle is a shortcut implementation of RuneEnumHandler based on a function.
type RuneEnumHandler ¶
type RuneEnumHandler interface { // Handle should do something with item of rune and its ordered number. // It is suggested to return EndOfRuneIterator to stop iteration. Handle(int, rune) error }
RuneEnumHandler is an object handling an item type of rune and its ordered number.
func RuneEnumHandlerSeries ¶
func RuneEnumHandlerSeries(handlers ...RuneEnumHandler) RuneEnumHandler
RuneEnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type RuneEnumIterator ¶
type RuneEnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...RuneEnumHandler) error }
RuneEnumIterator is an iterator over items and their ordering numbers.
func MakeRuneEnumIterator ¶
func MakeRuneEnumIterator(maker RuneIterMaker) RuneEnumIterator
MakeRuneEnumIterator constructs an instance implementing RuneEnumIterator based on RuneIterMaker.
func ToRuneEnumIterator ¶
func ToRuneEnumIterator(iter RuneIterator) RuneEnumIterator
ToRuneEnumIterator constructs an instance implementing RuneEnumIterator based on RuneIterator.
type RuneHandle ¶
RuneHandle is a shortcut implementation of RuneHandler based on a function.
func (RuneHandle) Handle ¶
func (h RuneHandle) Handle(item rune) error
Handle does something with item of rune. It is suggested to return EndOfRuneIterator to stop iteration.
type RuneHandler ¶
type RuneHandler interface { // Handle should do something with item of rune. // It is suggested to return EndOfRuneIterator to stop iteration. Handle(rune) error }
RuneHandler is an object handling an item type of rune.
var RuneDoNothing RuneHandler = RuneHandle(func(_ rune) error { return nil })
RuneDoNothing does nothing.
func RuneHandlerSeries ¶
func RuneHandlerSeries(handlers ...RuneHandler) RuneHandler
RuneHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type RuneIterMaker ¶
type RuneIterMaker interface { // MakeIter should return a new instance of RuneIterator to iterate over it. MakeIter() RuneIterator }
RuneIterMaker is a maker of RuneIterator.
var MakeNoRuneIter RuneIterMaker = MakeRuneIter( func() RuneIterator { return EmptyRuneIterator })
MakeNoRuneIter is a zero value for RuneIterMaker. It always returns EmptyRuneIterator and an empty error.
type RuneIterator ¶
type RuneIterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() rune // Err contains first met error while Next. Err() error }
RuneIterator is an iterator over items type of rune.
var EmptyRuneIterator RuneIterator = emptyRuneIterator{}
EmptyRuneIterator is a zero value for RuneIterator. It is not contains any item to iterate over it.
func PriorRuneEnumIterator ¶ added in v0.0.4
func PriorRuneEnumIterator(comparer RuneEnumComparer, itemList ...RuneIterator) RuneIterator
PriorRuneEnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorRuneIterator ¶ added in v0.0.2
func PriorRuneIterator(comparer RuneComparer, itemList ...RuneIterator) RuneIterator
PriorRuneIterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func RuneConverting ¶
func RuneConverting(items RuneIterator, converters ...RuneConverter) RuneIterator
RuneConverting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func RuneDoingUntil ¶
func RuneDoingUntil(items RuneIterator, untilList ...RuneChecker) RuneIterator
RuneDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func RuneEnumConverting ¶
func RuneEnumConverting(items RuneIterator, converters ...RuneEnumConverter) RuneIterator
RuneEnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func RuneEnumDoingUntil ¶
func RuneEnumDoingUntil(items RuneIterator, untilList ...RuneEnumChecker) RuneIterator
RuneEnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func RuneEnumFiltering ¶
func RuneEnumFiltering(items RuneIterator, filters ...RuneEnumChecker) RuneIterator
RuneEnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func RuneEnumHandling ¶
func RuneEnumHandling(items RuneIterator, handlers ...RuneEnumHandler) RuneIterator
RuneEnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func RuneFiltering ¶
func RuneFiltering(items RuneIterator, filters ...RuneChecker) RuneIterator
RuneFiltering sets filter while iterating over items. If filters is empty, so all items will return.
func RuneGettingBatch ¶
func RuneGettingBatch(items RuneIterator, batchSize int) RuneIterator
RuneGettingBatch returns the next batch from items.
func RuneHandling ¶
func RuneHandling(items RuneIterator, handlers ...RuneHandler) RuneIterator
RuneHandling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func RuneInvert ¶
func RuneInvert(items RuneIterator) RuneIterator
RuneInvert unrolls items and make inverting iterator based on them.
func SuperRuneIterator ¶
func SuperRuneIterator(itemList ...RuneIterator) RuneIterator
SuperRuneIterator combines all iterators to one.
type RuneRangeIterator ¶
type RuneRangeIterator interface { // Range should iterate over items. Range(...RuneHandler) error }
RuneRangeIterator is an iterator over items.
func MakeRuneRangeIterator ¶
func MakeRuneRangeIterator(maker RuneIterMaker) RuneRangeIterator
MakeRuneRangeIterator constructs an instance implementing RuneRangeIterator based on RuneIterMaker.
func ToRuneRangeIterator ¶
func ToRuneRangeIterator(iter RuneIterator) RuneRangeIterator
ToRuneRangeIterator constructs an instance implementing RuneRangeIterator based on RuneIterator.
type RuneSlice ¶
type RuneSlice []rune
RuneSlice is a slice of rune.
func RuneUnroll ¶
func RuneUnroll(items RuneIterator) RuneSlice
RuneUnroll unrolls items to slice of rune.
func (RuneSlice) MakeIter ¶
func (s RuneSlice) MakeIter() RuneIterator
MakeIter returns a new instance of RuneIterator to iterate over it. It returns EmptyRuneIterator if the error is not nil.
type RuneSliceIterator ¶
type RuneSliceIterator struct {
// contains filtered or unexported fields
}
RuneSliceIterator is an iterator based on a slice of rune.
func NewRuneSliceIterator ¶ added in v0.0.2
func NewRuneSliceIterator(slice []rune) *RuneSliceIterator
NewRuneSliceIterator returns a new instance of RuneSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use RuneUnroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (RuneSliceIterator) Err ¶
func (RuneSliceIterator) Err() error
Err contains first met error while Next.
func (RuneSliceIterator) HasNext ¶
func (it RuneSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*RuneSliceIterator) Next ¶
func (it *RuneSliceIterator) Next() rune
Next returns next item in the iterator. It should be invoked after check HasNext.
type SliceIterator ¶
type SliceIterator struct {
// contains filtered or unexported fields
}
SliceIterator is an iterator based on a slice of interface{}.
func NewSliceIterator ¶ added in v0.0.2
func NewSliceIterator(slice []interface{}) *SliceIterator
NewSliceIterator returns a new instance of SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (SliceIterator) Err ¶
func (SliceIterator) Err() error
Err contains first met error while Next.
func (SliceIterator) HasNext ¶
func (it SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*SliceIterator) Next ¶
func (it *SliceIterator) Next() interface{}
Next returns next item in the iterator. It should be invoked after check HasNext.
type StringCheck ¶
StringCheck is a shortcut implementation of StringChecker based on a function.
type StringChecker ¶
type StringChecker interface { // Check should check an item type of string for some condition. // It is suggested to return EndOfStringIterator to stop iteration. Check(string) (bool, error) }
StringChecker is an object checking an item type of string for some condition.
var ( // AlwaysStringCheckTrue always returns true and empty error. AlwaysStringCheckTrue StringChecker = StringCheck( func(item string) (bool, error) { return true, nil }) // AlwaysStringCheckFalse always returns false and empty error. AlwaysStringCheckFalse StringChecker = StringCheck( func(item string) (bool, error) { return false, nil }) )
func AllString ¶
func AllString(checkers ...StringChecker) StringChecker
AllString combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyString ¶
func AnyString(checkers ...StringChecker) StringChecker
AnyString combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotString ¶
func NotString(checker StringChecker) StringChecker
NotString do an inversion for checker result. It is returns AlwaysStringCheckTrue if checker is nil.
type StringCompare ¶ added in v0.0.2
StringCompare is a shortcut implementation of StringEnumComparer based on a function.
func (StringCompare) IsLess ¶ added in v0.0.2
func (c StringCompare) IsLess(lhs, rhs string) bool
IsLess is true if lhs is less than rhs.
type StringComparer ¶ added in v0.0.2
type StringComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs string) bool }
StringEnumComparer is a strategy to compare two types.
var StringAlwaysLess StringComparer = StringCompare(func(_, _ string) bool { return true })
EnumStringAlwaysLess is an implementation of StringEnumComparer returning always true.
type StringConvert ¶
StringConvert is a shortcut implementation of StringConverter based on a function.
type StringConverter ¶
type StringConverter interface { // Convert should convert an item type of string into another item of string. // It is suggested to return EndOfStringIterator to stop iteration. Convert(string) (string, error) }
StringConverter is an object converting an item type of string.
var NoStringConvert StringConverter = StringConvert( func(item string) (string, error) { return item, nil })
NoStringConvert does nothing with item, just returns it as is.
func StringConverterSeries ¶
func StringConverterSeries(converters ...StringConverter) StringConverter
StringConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type StringEnumCheck ¶
StringEnumCheck is a shortcut implementation of StringEnumChecker based on a function.
type StringEnumChecker ¶
type StringEnumChecker interface { // Check checks an item type of string and its ordering number for some condition. // It is suggested to return EndOfStringIterator to stop iteration. Check(int, string) (bool, error) }
StringEnumChecker is an object checking an item type of string and its ordering number in for some condition.
func EnumAllString ¶
func EnumAllString(checkers ...StringEnumChecker) StringEnumChecker
EnumAllString combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyString ¶
func EnumAnyString(checkers ...StringEnumChecker) StringEnumChecker
EnumAnyString combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromStringChecker ¶
func EnumFromStringChecker(checker StringChecker) StringEnumChecker
EnumFromStringChecker adapts checker type of StringChecker to the interface StringEnumChecker. If checker is nil it is return based on AlwaysStringCheckFalse enum checker.
func EnumNotString ¶
func EnumNotString(checker StringEnumChecker) StringEnumChecker
EnumNotString do an inversion for checker result. It is returns AlwaysStringEnumCheckTrue if checker is nil.
type StringEnumCompare ¶ added in v0.0.4
StringEnumCompare is a shortcut implementation of StringEnumComparer based on a function.
type StringEnumComparer ¶ added in v0.0.4
type StringEnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs string, nRHS int, rhs string) bool }
StringEnumComparer is a strategy to compare two types and their order numbers.
var EnumStringAlwaysLess StringEnumComparer = StringEnumCompare( func(_ int, _ string, _ int, _ string) bool { return true })
EnumStringAlwaysLess is an implementation of StringEnumComparer returning always true.
type StringEnumConvert ¶
StringEnumConvert is a shortcut implementation of StringEnumConverter based on a function.
type StringEnumConverter ¶
type StringEnumConverter interface { // Convert should convert an item type of string into another item of string. // It is suggested to return EndOfStringIterator to stop iteration. Convert(n int, val string) (string, error) }
StringEnumConverter is an object converting an item type of string and its ordering number.
var NoStringEnumConvert StringEnumConverter = StringEnumConvert( func(_ int, item string) (string, error) { return item, nil })
NoStringEnumConvert does nothing with item, just returns it as is.
func EnumFromStringConverter ¶
func EnumFromStringConverter(converter StringConverter) StringEnumConverter
EnumFromStringConverter adapts checker type of StringConverter to the interface StringEnumConverter. If converter is nil it is return based on NoStringConvert enum checker.
func EnumStringConverterSeries ¶
func EnumStringConverterSeries(converters ...StringEnumConverter) StringEnumConverter
EnumStringConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type StringEnumHandle ¶
StringEnumHandle is a shortcut implementation of StringEnumHandler based on a function.
type StringEnumHandler ¶
type StringEnumHandler interface { // Handle should do something with item of string and its ordered number. // It is suggested to return EndOfStringIterator to stop iteration. Handle(int, string) error }
StringEnumHandler is an object handling an item type of string and its ordered number.
func StringEnumHandlerSeries ¶
func StringEnumHandlerSeries(handlers ...StringEnumHandler) StringEnumHandler
StringEnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type StringEnumIterator ¶
type StringEnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...StringEnumHandler) error }
StringEnumIterator is an iterator over items and their ordering numbers.
func MakeStringEnumIterator ¶
func MakeStringEnumIterator(maker StringIterMaker) StringEnumIterator
MakeStringEnumIterator constructs an instance implementing StringEnumIterator based on StringIterMaker.
func ToStringEnumIterator ¶
func ToStringEnumIterator(iter StringIterator) StringEnumIterator
ToStringEnumIterator constructs an instance implementing StringEnumIterator based on StringIterator.
type StringHandle ¶
StringHandle is a shortcut implementation of StringHandler based on a function.
func (StringHandle) Handle ¶
func (h StringHandle) Handle(item string) error
Handle does something with item of string. It is suggested to return EndOfStringIterator to stop iteration.
type StringHandler ¶
type StringHandler interface { // Handle should do something with item of string. // It is suggested to return EndOfStringIterator to stop iteration. Handle(string) error }
StringHandler is an object handling an item type of string.
var StringDoNothing StringHandler = StringHandle(func(_ string) error { return nil })
StringDoNothing does nothing.
func StringHandlerSeries ¶
func StringHandlerSeries(handlers ...StringHandler) StringHandler
StringHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type StringIterMaker ¶
type StringIterMaker interface { // MakeIter should return a new instance of StringIterator to iterate over it. MakeIter() StringIterator }
StringIterMaker is a maker of StringIterator.
var MakeNoStringIter StringIterMaker = MakeStringIter( func() StringIterator { return EmptyStringIterator })
MakeNoStringIter is a zero value for StringIterMaker. It always returns EmptyStringIterator and an empty error.
type StringIterator ¶
type StringIterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() string // Err contains first met error while Next. Err() error }
StringIterator is an iterator over items type of string.
var EmptyStringIterator StringIterator = emptyStringIterator{}
EmptyStringIterator is a zero value for StringIterator. It is not contains any item to iterate over it.
func PriorStringEnumIterator ¶ added in v0.0.4
func PriorStringEnumIterator(comparer StringEnumComparer, itemList ...StringIterator) StringIterator
PriorStringEnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorStringIterator ¶ added in v0.0.2
func PriorStringIterator(comparer StringComparer, itemList ...StringIterator) StringIterator
PriorStringIterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func StringConverting ¶
func StringConverting(items StringIterator, converters ...StringConverter) StringIterator
StringConverting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func StringDoingUntil ¶
func StringDoingUntil(items StringIterator, untilList ...StringChecker) StringIterator
StringDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func StringEnumConverting ¶
func StringEnumConverting(items StringIterator, converters ...StringEnumConverter) StringIterator
StringEnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func StringEnumDoingUntil ¶
func StringEnumDoingUntil(items StringIterator, untilList ...StringEnumChecker) StringIterator
StringEnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func StringEnumFiltering ¶
func StringEnumFiltering(items StringIterator, filters ...StringEnumChecker) StringIterator
StringEnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func StringEnumHandling ¶
func StringEnumHandling(items StringIterator, handlers ...StringEnumHandler) StringIterator
StringEnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func StringFiltering ¶
func StringFiltering(items StringIterator, filters ...StringChecker) StringIterator
StringFiltering sets filter while iterating over items. If filters is empty, so all items will return.
func StringGettingBatch ¶
func StringGettingBatch(items StringIterator, batchSize int) StringIterator
StringGettingBatch returns the next batch from items.
func StringHandling ¶
func StringHandling(items StringIterator, handlers ...StringHandler) StringIterator
StringHandling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func StringInvert ¶
func StringInvert(items StringIterator) StringIterator
StringInvert unrolls items and make inverting iterator based on them.
func SuperStringIterator ¶
func SuperStringIterator(itemList ...StringIterator) StringIterator
SuperStringIterator combines all iterators to one.
type StringRangeIterator ¶
type StringRangeIterator interface { // Range should iterate over items. Range(...StringHandler) error }
StringRangeIterator is an iterator over items.
func MakeStringRangeIterator ¶
func MakeStringRangeIterator(maker StringIterMaker) StringRangeIterator
MakeStringRangeIterator constructs an instance implementing StringRangeIterator based on StringIterMaker.
func ToStringRangeIterator ¶
func ToStringRangeIterator(iter StringIterator) StringRangeIterator
ToStringRangeIterator constructs an instance implementing StringRangeIterator based on StringIterator.
type StringSlice ¶
type StringSlice []string
StringSlice is a slice of string.
func StringUnroll ¶
func StringUnroll(items StringIterator) StringSlice
StringUnroll unrolls items to slice of string.
func (StringSlice) MakeIter ¶
func (s StringSlice) MakeIter() StringIterator
MakeIter returns a new instance of StringIterator to iterate over it. It returns EmptyStringIterator if the error is not nil.
type StringSliceIterator ¶
type StringSliceIterator struct {
// contains filtered or unexported fields
}
StringSliceIterator is an iterator based on a slice of string.
func NewStringSliceIterator ¶ added in v0.0.2
func NewStringSliceIterator(slice []string) *StringSliceIterator
NewStringSliceIterator returns a new instance of StringSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use StringUnroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (StringSliceIterator) Err ¶
func (StringSliceIterator) Err() error
Err contains first met error while Next.
func (StringSliceIterator) HasNext ¶
func (it StringSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*StringSliceIterator) Next ¶
func (it *StringSliceIterator) Next() string
Next returns next item in the iterator. It should be invoked after check HasNext.
type Uint16Check ¶
Uint16Check is a shortcut implementation of Uint16Checker based on a function.
type Uint16Checker ¶
type Uint16Checker interface { // Check should check an item type of uint16 for some condition. // It is suggested to return EndOfUint16Iterator to stop iteration. Check(uint16) (bool, error) }
Uint16Checker is an object checking an item type of uint16 for some condition.
var ( // AlwaysUint16CheckTrue always returns true and empty error. AlwaysUint16CheckTrue Uint16Checker = Uint16Check( func(item uint16) (bool, error) { return true, nil }) // AlwaysUint16CheckFalse always returns false and empty error. AlwaysUint16CheckFalse Uint16Checker = Uint16Check( func(item uint16) (bool, error) { return false, nil }) )
func AllUint16 ¶
func AllUint16(checkers ...Uint16Checker) Uint16Checker
AllUint16 combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyUint16 ¶
func AnyUint16(checkers ...Uint16Checker) Uint16Checker
AnyUint16 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotUint16 ¶
func NotUint16(checker Uint16Checker) Uint16Checker
NotUint16 do an inversion for checker result. It is returns AlwaysUint16CheckTrue if checker is nil.
type Uint16Compare ¶ added in v0.0.2
Uint16Compare is a shortcut implementation of Uint16EnumComparer based on a function.
func (Uint16Compare) IsLess ¶ added in v0.0.2
func (c Uint16Compare) IsLess(lhs, rhs uint16) bool
IsLess is true if lhs is less than rhs.
type Uint16Comparer ¶ added in v0.0.2
type Uint16Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs uint16) bool }
Uint16EnumComparer is a strategy to compare two types.
var Uint16AlwaysLess Uint16Comparer = Uint16Compare(func(_, _ uint16) bool { return true })
EnumUint16AlwaysLess is an implementation of Uint16EnumComparer returning always true.
type Uint16Convert ¶
Uint16Convert is a shortcut implementation of Uint16Converter based on a function.
type Uint16Converter ¶
type Uint16Converter interface { // Convert should convert an item type of uint16 into another item of uint16. // It is suggested to return EndOfUint16Iterator to stop iteration. Convert(uint16) (uint16, error) }
Uint16Converter is an object converting an item type of uint16.
var NoUint16Convert Uint16Converter = Uint16Convert( func(item uint16) (uint16, error) { return item, nil })
NoUint16Convert does nothing with item, just returns it as is.
func Uint16ConverterSeries ¶
func Uint16ConverterSeries(converters ...Uint16Converter) Uint16Converter
Uint16ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Uint16EnumCheck ¶
Uint16EnumCheck is a shortcut implementation of Uint16EnumChecker based on a function.
type Uint16EnumChecker ¶
type Uint16EnumChecker interface { // Check checks an item type of uint16 and its ordering number for some condition. // It is suggested to return EndOfUint16Iterator to stop iteration. Check(int, uint16) (bool, error) }
Uint16EnumChecker is an object checking an item type of uint16 and its ordering number in for some condition.
func EnumAllUint16 ¶
func EnumAllUint16(checkers ...Uint16EnumChecker) Uint16EnumChecker
EnumAllUint16 combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyUint16 ¶
func EnumAnyUint16(checkers ...Uint16EnumChecker) Uint16EnumChecker
EnumAnyUint16 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromUint16Checker ¶
func EnumFromUint16Checker(checker Uint16Checker) Uint16EnumChecker
EnumFromUint16Checker adapts checker type of Uint16Checker to the interface Uint16EnumChecker. If checker is nil it is return based on AlwaysUint16CheckFalse enum checker.
func EnumNotUint16 ¶
func EnumNotUint16(checker Uint16EnumChecker) Uint16EnumChecker
EnumNotUint16 do an inversion for checker result. It is returns AlwaysUint16EnumCheckTrue if checker is nil.
type Uint16EnumCompare ¶ added in v0.0.4
Uint16EnumCompare is a shortcut implementation of Uint16EnumComparer based on a function.
type Uint16EnumComparer ¶ added in v0.0.4
type Uint16EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs uint16, nRHS int, rhs uint16) bool }
Uint16EnumComparer is a strategy to compare two types and their order numbers.
var EnumUint16AlwaysLess Uint16EnumComparer = Uint16EnumCompare( func(_ int, _ uint16, _ int, _ uint16) bool { return true })
EnumUint16AlwaysLess is an implementation of Uint16EnumComparer returning always true.
type Uint16EnumConvert ¶
Uint16EnumConvert is a shortcut implementation of Uint16EnumConverter based on a function.
type Uint16EnumConverter ¶
type Uint16EnumConverter interface { // Convert should convert an item type of uint16 into another item of uint16. // It is suggested to return EndOfUint16Iterator to stop iteration. Convert(n int, val uint16) (uint16, error) }
Uint16EnumConverter is an object converting an item type of uint16 and its ordering number.
var NoUint16EnumConvert Uint16EnumConverter = Uint16EnumConvert( func(_ int, item uint16) (uint16, error) { return item, nil })
NoUint16EnumConvert does nothing with item, just returns it as is.
func EnumFromUint16Converter ¶
func EnumFromUint16Converter(converter Uint16Converter) Uint16EnumConverter
EnumFromUint16Converter adapts checker type of Uint16Converter to the interface Uint16EnumConverter. If converter is nil it is return based on NoUint16Convert enum checker.
func EnumUint16ConverterSeries ¶
func EnumUint16ConverterSeries(converters ...Uint16EnumConverter) Uint16EnumConverter
EnumUint16ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Uint16EnumHandle ¶
Uint16EnumHandle is a shortcut implementation of Uint16EnumHandler based on a function.
type Uint16EnumHandler ¶
type Uint16EnumHandler interface { // Handle should do something with item of uint16 and its ordered number. // It is suggested to return EndOfUint16Iterator to stop iteration. Handle(int, uint16) error }
Uint16EnumHandler is an object handling an item type of uint16 and its ordered number.
func Uint16EnumHandlerSeries ¶
func Uint16EnumHandlerSeries(handlers ...Uint16EnumHandler) Uint16EnumHandler
Uint16EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Uint16EnumIterator ¶
type Uint16EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...Uint16EnumHandler) error }
Uint16EnumIterator is an iterator over items and their ordering numbers.
func MakeUint16EnumIterator ¶
func MakeUint16EnumIterator(maker Uint16IterMaker) Uint16EnumIterator
MakeUint16EnumIterator constructs an instance implementing Uint16EnumIterator based on Uint16IterMaker.
func ToUint16EnumIterator ¶
func ToUint16EnumIterator(iter Uint16Iterator) Uint16EnumIterator
ToUint16EnumIterator constructs an instance implementing Uint16EnumIterator based on Uint16Iterator.
type Uint16Handle ¶
Uint16Handle is a shortcut implementation of Uint16Handler based on a function.
func (Uint16Handle) Handle ¶
func (h Uint16Handle) Handle(item uint16) error
Handle does something with item of uint16. It is suggested to return EndOfUint16Iterator to stop iteration.
type Uint16Handler ¶
type Uint16Handler interface { // Handle should do something with item of uint16. // It is suggested to return EndOfUint16Iterator to stop iteration. Handle(uint16) error }
Uint16Handler is an object handling an item type of uint16.
var Uint16DoNothing Uint16Handler = Uint16Handle(func(_ uint16) error { return nil })
Uint16DoNothing does nothing.
func Uint16HandlerSeries ¶
func Uint16HandlerSeries(handlers ...Uint16Handler) Uint16Handler
Uint16HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Uint16IterMaker ¶
type Uint16IterMaker interface { // MakeIter should return a new instance of Uint16Iterator to iterate over it. MakeIter() Uint16Iterator }
Uint16IterMaker is a maker of Uint16Iterator.
var MakeNoUint16Iter Uint16IterMaker = MakeUint16Iter( func() Uint16Iterator { return EmptyUint16Iterator })
MakeNoUint16Iter is a zero value for Uint16IterMaker. It always returns EmptyUint16Iterator and an empty error.
type Uint16Iterator ¶
type Uint16Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() uint16 // Err contains first met error while Next. Err() error }
Uint16Iterator is an iterator over items type of uint16.
var EmptyUint16Iterator Uint16Iterator = emptyUint16Iterator{}
EmptyUint16Iterator is a zero value for Uint16Iterator. It is not contains any item to iterate over it.
func PriorUint16EnumIterator ¶ added in v0.0.4
func PriorUint16EnumIterator(comparer Uint16EnumComparer, itemList ...Uint16Iterator) Uint16Iterator
PriorUint16EnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorUint16Iterator ¶ added in v0.0.2
func PriorUint16Iterator(comparer Uint16Comparer, itemList ...Uint16Iterator) Uint16Iterator
PriorUint16Iterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperUint16Iterator ¶
func SuperUint16Iterator(itemList ...Uint16Iterator) Uint16Iterator
SuperUint16Iterator combines all iterators to one.
func Uint16Converting ¶
func Uint16Converting(items Uint16Iterator, converters ...Uint16Converter) Uint16Iterator
Uint16Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func Uint16DoingUntil ¶
func Uint16DoingUntil(items Uint16Iterator, untilList ...Uint16Checker) Uint16Iterator
Uint16DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Uint16EnumConverting ¶
func Uint16EnumConverting(items Uint16Iterator, converters ...Uint16EnumConverter) Uint16Iterator
Uint16EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func Uint16EnumDoingUntil ¶
func Uint16EnumDoingUntil(items Uint16Iterator, untilList ...Uint16EnumChecker) Uint16Iterator
Uint16EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Uint16EnumFiltering ¶
func Uint16EnumFiltering(items Uint16Iterator, filters ...Uint16EnumChecker) Uint16Iterator
Uint16EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func Uint16EnumHandling ¶
func Uint16EnumHandling(items Uint16Iterator, handlers ...Uint16EnumHandler) Uint16Iterator
Uint16EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Uint16Filtering ¶
func Uint16Filtering(items Uint16Iterator, filters ...Uint16Checker) Uint16Iterator
Uint16Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func Uint16GettingBatch ¶
func Uint16GettingBatch(items Uint16Iterator, batchSize int) Uint16Iterator
Uint16GettingBatch returns the next batch from items.
func Uint16Handling ¶
func Uint16Handling(items Uint16Iterator, handlers ...Uint16Handler) Uint16Iterator
Uint16Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func Uint16Invert ¶
func Uint16Invert(items Uint16Iterator) Uint16Iterator
Uint16Invert unrolls items and make inverting iterator based on them.
type Uint16RangeIterator ¶
type Uint16RangeIterator interface { // Range should iterate over items. Range(...Uint16Handler) error }
Uint16RangeIterator is an iterator over items.
func MakeUint16RangeIterator ¶
func MakeUint16RangeIterator(maker Uint16IterMaker) Uint16RangeIterator
MakeUint16RangeIterator constructs an instance implementing Uint16RangeIterator based on Uint16IterMaker.
func ToUint16RangeIterator ¶
func ToUint16RangeIterator(iter Uint16Iterator) Uint16RangeIterator
ToUint16RangeIterator constructs an instance implementing Uint16RangeIterator based on Uint16Iterator.
type Uint16Slice ¶
type Uint16Slice []uint16
Uint16Slice is a slice of uint16.
func Uint16Unroll ¶
func Uint16Unroll(items Uint16Iterator) Uint16Slice
Uint16Unroll unrolls items to slice of uint16.
func (Uint16Slice) MakeIter ¶
func (s Uint16Slice) MakeIter() Uint16Iterator
MakeIter returns a new instance of Uint16Iterator to iterate over it. It returns EmptyUint16Iterator if the error is not nil.
type Uint16SliceIterator ¶
type Uint16SliceIterator struct {
// contains filtered or unexported fields
}
Uint16SliceIterator is an iterator based on a slice of uint16.
func NewUint16SliceIterator ¶ added in v0.0.2
func NewUint16SliceIterator(slice []uint16) *Uint16SliceIterator
NewUint16SliceIterator returns a new instance of Uint16SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Uint16Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (Uint16SliceIterator) Err ¶
func (Uint16SliceIterator) Err() error
Err contains first met error while Next.
func (Uint16SliceIterator) HasNext ¶
func (it Uint16SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*Uint16SliceIterator) Next ¶
func (it *Uint16SliceIterator) Next() uint16
Next returns next item in the iterator. It should be invoked after check HasNext.
type Uint32Check ¶
Uint32Check is a shortcut implementation of Uint32Checker based on a function.
type Uint32Checker ¶
type Uint32Checker interface { // Check should check an item type of uint32 for some condition. // It is suggested to return EndOfUint32Iterator to stop iteration. Check(uint32) (bool, error) }
Uint32Checker is an object checking an item type of uint32 for some condition.
var ( // AlwaysUint32CheckTrue always returns true and empty error. AlwaysUint32CheckTrue Uint32Checker = Uint32Check( func(item uint32) (bool, error) { return true, nil }) // AlwaysUint32CheckFalse always returns false and empty error. AlwaysUint32CheckFalse Uint32Checker = Uint32Check( func(item uint32) (bool, error) { return false, nil }) )
func AllUint32 ¶
func AllUint32(checkers ...Uint32Checker) Uint32Checker
AllUint32 combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyUint32 ¶
func AnyUint32(checkers ...Uint32Checker) Uint32Checker
AnyUint32 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotUint32 ¶
func NotUint32(checker Uint32Checker) Uint32Checker
NotUint32 do an inversion for checker result. It is returns AlwaysUint32CheckTrue if checker is nil.
type Uint32Compare ¶ added in v0.0.2
Uint32Compare is a shortcut implementation of Uint32EnumComparer based on a function.
func (Uint32Compare) IsLess ¶ added in v0.0.2
func (c Uint32Compare) IsLess(lhs, rhs uint32) bool
IsLess is true if lhs is less than rhs.
type Uint32Comparer ¶ added in v0.0.2
type Uint32Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs uint32) bool }
Uint32EnumComparer is a strategy to compare two types.
var Uint32AlwaysLess Uint32Comparer = Uint32Compare(func(_, _ uint32) bool { return true })
EnumUint32AlwaysLess is an implementation of Uint32EnumComparer returning always true.
type Uint32Convert ¶
Uint32Convert is a shortcut implementation of Uint32Converter based on a function.
type Uint32Converter ¶
type Uint32Converter interface { // Convert should convert an item type of uint32 into another item of uint32. // It is suggested to return EndOfUint32Iterator to stop iteration. Convert(uint32) (uint32, error) }
Uint32Converter is an object converting an item type of uint32.
var NoUint32Convert Uint32Converter = Uint32Convert( func(item uint32) (uint32, error) { return item, nil })
NoUint32Convert does nothing with item, just returns it as is.
func Uint32ConverterSeries ¶
func Uint32ConverterSeries(converters ...Uint32Converter) Uint32Converter
Uint32ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Uint32EnumCheck ¶
Uint32EnumCheck is a shortcut implementation of Uint32EnumChecker based on a function.
type Uint32EnumChecker ¶
type Uint32EnumChecker interface { // Check checks an item type of uint32 and its ordering number for some condition. // It is suggested to return EndOfUint32Iterator to stop iteration. Check(int, uint32) (bool, error) }
Uint32EnumChecker is an object checking an item type of uint32 and its ordering number in for some condition.
func EnumAllUint32 ¶
func EnumAllUint32(checkers ...Uint32EnumChecker) Uint32EnumChecker
EnumAllUint32 combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyUint32 ¶
func EnumAnyUint32(checkers ...Uint32EnumChecker) Uint32EnumChecker
EnumAnyUint32 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromUint32Checker ¶
func EnumFromUint32Checker(checker Uint32Checker) Uint32EnumChecker
EnumFromUint32Checker adapts checker type of Uint32Checker to the interface Uint32EnumChecker. If checker is nil it is return based on AlwaysUint32CheckFalse enum checker.
func EnumNotUint32 ¶
func EnumNotUint32(checker Uint32EnumChecker) Uint32EnumChecker
EnumNotUint32 do an inversion for checker result. It is returns AlwaysUint32EnumCheckTrue if checker is nil.
type Uint32EnumCompare ¶ added in v0.0.4
Uint32EnumCompare is a shortcut implementation of Uint32EnumComparer based on a function.
type Uint32EnumComparer ¶ added in v0.0.4
type Uint32EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs uint32, nRHS int, rhs uint32) bool }
Uint32EnumComparer is a strategy to compare two types and their order numbers.
var EnumUint32AlwaysLess Uint32EnumComparer = Uint32EnumCompare( func(_ int, _ uint32, _ int, _ uint32) bool { return true })
EnumUint32AlwaysLess is an implementation of Uint32EnumComparer returning always true.
type Uint32EnumConvert ¶
Uint32EnumConvert is a shortcut implementation of Uint32EnumConverter based on a function.
type Uint32EnumConverter ¶
type Uint32EnumConverter interface { // Convert should convert an item type of uint32 into another item of uint32. // It is suggested to return EndOfUint32Iterator to stop iteration. Convert(n int, val uint32) (uint32, error) }
Uint32EnumConverter is an object converting an item type of uint32 and its ordering number.
var NoUint32EnumConvert Uint32EnumConverter = Uint32EnumConvert( func(_ int, item uint32) (uint32, error) { return item, nil })
NoUint32EnumConvert does nothing with item, just returns it as is.
func EnumFromUint32Converter ¶
func EnumFromUint32Converter(converter Uint32Converter) Uint32EnumConverter
EnumFromUint32Converter adapts checker type of Uint32Converter to the interface Uint32EnumConverter. If converter is nil it is return based on NoUint32Convert enum checker.
func EnumUint32ConverterSeries ¶
func EnumUint32ConverterSeries(converters ...Uint32EnumConverter) Uint32EnumConverter
EnumUint32ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Uint32EnumHandle ¶
Uint32EnumHandle is a shortcut implementation of Uint32EnumHandler based on a function.
type Uint32EnumHandler ¶
type Uint32EnumHandler interface { // Handle should do something with item of uint32 and its ordered number. // It is suggested to return EndOfUint32Iterator to stop iteration. Handle(int, uint32) error }
Uint32EnumHandler is an object handling an item type of uint32 and its ordered number.
func Uint32EnumHandlerSeries ¶
func Uint32EnumHandlerSeries(handlers ...Uint32EnumHandler) Uint32EnumHandler
Uint32EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Uint32EnumIterator ¶
type Uint32EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...Uint32EnumHandler) error }
Uint32EnumIterator is an iterator over items and their ordering numbers.
func MakeUint32EnumIterator ¶
func MakeUint32EnumIterator(maker Uint32IterMaker) Uint32EnumIterator
MakeUint32EnumIterator constructs an instance implementing Uint32EnumIterator based on Uint32IterMaker.
func ToUint32EnumIterator ¶
func ToUint32EnumIterator(iter Uint32Iterator) Uint32EnumIterator
ToUint32EnumIterator constructs an instance implementing Uint32EnumIterator based on Uint32Iterator.
type Uint32Handle ¶
Uint32Handle is a shortcut implementation of Uint32Handler based on a function.
func (Uint32Handle) Handle ¶
func (h Uint32Handle) Handle(item uint32) error
Handle does something with item of uint32. It is suggested to return EndOfUint32Iterator to stop iteration.
type Uint32Handler ¶
type Uint32Handler interface { // Handle should do something with item of uint32. // It is suggested to return EndOfUint32Iterator to stop iteration. Handle(uint32) error }
Uint32Handler is an object handling an item type of uint32.
var Uint32DoNothing Uint32Handler = Uint32Handle(func(_ uint32) error { return nil })
Uint32DoNothing does nothing.
func Uint32HandlerSeries ¶
func Uint32HandlerSeries(handlers ...Uint32Handler) Uint32Handler
Uint32HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Uint32IterMaker ¶
type Uint32IterMaker interface { // MakeIter should return a new instance of Uint32Iterator to iterate over it. MakeIter() Uint32Iterator }
Uint32IterMaker is a maker of Uint32Iterator.
var MakeNoUint32Iter Uint32IterMaker = MakeUint32Iter( func() Uint32Iterator { return EmptyUint32Iterator })
MakeNoUint32Iter is a zero value for Uint32IterMaker. It always returns EmptyUint32Iterator and an empty error.
type Uint32Iterator ¶
type Uint32Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() uint32 // Err contains first met error while Next. Err() error }
Uint32Iterator is an iterator over items type of uint32.
var EmptyUint32Iterator Uint32Iterator = emptyUint32Iterator{}
EmptyUint32Iterator is a zero value for Uint32Iterator. It is not contains any item to iterate over it.
func PriorUint32EnumIterator ¶ added in v0.0.4
func PriorUint32EnumIterator(comparer Uint32EnumComparer, itemList ...Uint32Iterator) Uint32Iterator
PriorUint32EnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorUint32Iterator ¶ added in v0.0.2
func PriorUint32Iterator(comparer Uint32Comparer, itemList ...Uint32Iterator) Uint32Iterator
PriorUint32Iterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperUint32Iterator ¶
func SuperUint32Iterator(itemList ...Uint32Iterator) Uint32Iterator
SuperUint32Iterator combines all iterators to one.
func Uint32Converting ¶
func Uint32Converting(items Uint32Iterator, converters ...Uint32Converter) Uint32Iterator
Uint32Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func Uint32DoingUntil ¶
func Uint32DoingUntil(items Uint32Iterator, untilList ...Uint32Checker) Uint32Iterator
Uint32DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Uint32EnumConverting ¶
func Uint32EnumConverting(items Uint32Iterator, converters ...Uint32EnumConverter) Uint32Iterator
Uint32EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func Uint32EnumDoingUntil ¶
func Uint32EnumDoingUntil(items Uint32Iterator, untilList ...Uint32EnumChecker) Uint32Iterator
Uint32EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Uint32EnumFiltering ¶
func Uint32EnumFiltering(items Uint32Iterator, filters ...Uint32EnumChecker) Uint32Iterator
Uint32EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func Uint32EnumHandling ¶
func Uint32EnumHandling(items Uint32Iterator, handlers ...Uint32EnumHandler) Uint32Iterator
Uint32EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Uint32Filtering ¶
func Uint32Filtering(items Uint32Iterator, filters ...Uint32Checker) Uint32Iterator
Uint32Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func Uint32GettingBatch ¶
func Uint32GettingBatch(items Uint32Iterator, batchSize int) Uint32Iterator
Uint32GettingBatch returns the next batch from items.
func Uint32Handling ¶
func Uint32Handling(items Uint32Iterator, handlers ...Uint32Handler) Uint32Iterator
Uint32Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func Uint32Invert ¶
func Uint32Invert(items Uint32Iterator) Uint32Iterator
Uint32Invert unrolls items and make inverting iterator based on them.
type Uint32RangeIterator ¶
type Uint32RangeIterator interface { // Range should iterate over items. Range(...Uint32Handler) error }
Uint32RangeIterator is an iterator over items.
func MakeUint32RangeIterator ¶
func MakeUint32RangeIterator(maker Uint32IterMaker) Uint32RangeIterator
MakeUint32RangeIterator constructs an instance implementing Uint32RangeIterator based on Uint32IterMaker.
func ToUint32RangeIterator ¶
func ToUint32RangeIterator(iter Uint32Iterator) Uint32RangeIterator
ToUint32RangeIterator constructs an instance implementing Uint32RangeIterator based on Uint32Iterator.
type Uint32Slice ¶
type Uint32Slice []uint32
Uint32Slice is a slice of uint32.
func Uint32Unroll ¶
func Uint32Unroll(items Uint32Iterator) Uint32Slice
Uint32Unroll unrolls items to slice of uint32.
func (Uint32Slice) MakeIter ¶
func (s Uint32Slice) MakeIter() Uint32Iterator
MakeIter returns a new instance of Uint32Iterator to iterate over it. It returns EmptyUint32Iterator if the error is not nil.
type Uint32SliceIterator ¶
type Uint32SliceIterator struct {
// contains filtered or unexported fields
}
Uint32SliceIterator is an iterator based on a slice of uint32.
func NewUint32SliceIterator ¶ added in v0.0.2
func NewUint32SliceIterator(slice []uint32) *Uint32SliceIterator
NewUint32SliceIterator returns a new instance of Uint32SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Uint32Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (Uint32SliceIterator) Err ¶
func (Uint32SliceIterator) Err() error
Err contains first met error while Next.
func (Uint32SliceIterator) HasNext ¶
func (it Uint32SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*Uint32SliceIterator) Next ¶
func (it *Uint32SliceIterator) Next() uint32
Next returns next item in the iterator. It should be invoked after check HasNext.
type Uint64Check ¶
Uint64Check is a shortcut implementation of Uint64Checker based on a function.
type Uint64Checker ¶
type Uint64Checker interface { // Check should check an item type of uint64 for some condition. // It is suggested to return EndOfUint64Iterator to stop iteration. Check(uint64) (bool, error) }
Uint64Checker is an object checking an item type of uint64 for some condition.
var ( // AlwaysUint64CheckTrue always returns true and empty error. AlwaysUint64CheckTrue Uint64Checker = Uint64Check( func(item uint64) (bool, error) { return true, nil }) // AlwaysUint64CheckFalse always returns false and empty error. AlwaysUint64CheckFalse Uint64Checker = Uint64Check( func(item uint64) (bool, error) { return false, nil }) )
func AllUint64 ¶
func AllUint64(checkers ...Uint64Checker) Uint64Checker
AllUint64 combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyUint64 ¶
func AnyUint64(checkers ...Uint64Checker) Uint64Checker
AnyUint64 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotUint64 ¶
func NotUint64(checker Uint64Checker) Uint64Checker
NotUint64 do an inversion for checker result. It is returns AlwaysUint64CheckTrue if checker is nil.
type Uint64Compare ¶ added in v0.0.2
Uint64Compare is a shortcut implementation of Uint64EnumComparer based on a function.
func (Uint64Compare) IsLess ¶ added in v0.0.2
func (c Uint64Compare) IsLess(lhs, rhs uint64) bool
IsLess is true if lhs is less than rhs.
type Uint64Comparer ¶ added in v0.0.2
type Uint64Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs uint64) bool }
Uint64EnumComparer is a strategy to compare two types.
var Uint64AlwaysLess Uint64Comparer = Uint64Compare(func(_, _ uint64) bool { return true })
EnumUint64AlwaysLess is an implementation of Uint64EnumComparer returning always true.
type Uint64Convert ¶
Uint64Convert is a shortcut implementation of Uint64Converter based on a function.
type Uint64Converter ¶
type Uint64Converter interface { // Convert should convert an item type of uint64 into another item of uint64. // It is suggested to return EndOfUint64Iterator to stop iteration. Convert(uint64) (uint64, error) }
Uint64Converter is an object converting an item type of uint64.
var NoUint64Convert Uint64Converter = Uint64Convert( func(item uint64) (uint64, error) { return item, nil })
NoUint64Convert does nothing with item, just returns it as is.
func Uint64ConverterSeries ¶
func Uint64ConverterSeries(converters ...Uint64Converter) Uint64Converter
Uint64ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Uint64EnumCheck ¶
Uint64EnumCheck is a shortcut implementation of Uint64EnumChecker based on a function.
type Uint64EnumChecker ¶
type Uint64EnumChecker interface { // Check checks an item type of uint64 and its ordering number for some condition. // It is suggested to return EndOfUint64Iterator to stop iteration. Check(int, uint64) (bool, error) }
Uint64EnumChecker is an object checking an item type of uint64 and its ordering number in for some condition.
func EnumAllUint64 ¶
func EnumAllUint64(checkers ...Uint64EnumChecker) Uint64EnumChecker
EnumAllUint64 combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyUint64 ¶
func EnumAnyUint64(checkers ...Uint64EnumChecker) Uint64EnumChecker
EnumAnyUint64 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromUint64Checker ¶
func EnumFromUint64Checker(checker Uint64Checker) Uint64EnumChecker
EnumFromUint64Checker adapts checker type of Uint64Checker to the interface Uint64EnumChecker. If checker is nil it is return based on AlwaysUint64CheckFalse enum checker.
func EnumNotUint64 ¶
func EnumNotUint64(checker Uint64EnumChecker) Uint64EnumChecker
EnumNotUint64 do an inversion for checker result. It is returns AlwaysUint64EnumCheckTrue if checker is nil.
type Uint64EnumCompare ¶ added in v0.0.4
Uint64EnumCompare is a shortcut implementation of Uint64EnumComparer based on a function.
type Uint64EnumComparer ¶ added in v0.0.4
type Uint64EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs uint64, nRHS int, rhs uint64) bool }
Uint64EnumComparer is a strategy to compare two types and their order numbers.
var EnumUint64AlwaysLess Uint64EnumComparer = Uint64EnumCompare( func(_ int, _ uint64, _ int, _ uint64) bool { return true })
EnumUint64AlwaysLess is an implementation of Uint64EnumComparer returning always true.
type Uint64EnumConvert ¶
Uint64EnumConvert is a shortcut implementation of Uint64EnumConverter based on a function.
type Uint64EnumConverter ¶
type Uint64EnumConverter interface { // Convert should convert an item type of uint64 into another item of uint64. // It is suggested to return EndOfUint64Iterator to stop iteration. Convert(n int, val uint64) (uint64, error) }
Uint64EnumConverter is an object converting an item type of uint64 and its ordering number.
var NoUint64EnumConvert Uint64EnumConverter = Uint64EnumConvert( func(_ int, item uint64) (uint64, error) { return item, nil })
NoUint64EnumConvert does nothing with item, just returns it as is.
func EnumFromUint64Converter ¶
func EnumFromUint64Converter(converter Uint64Converter) Uint64EnumConverter
EnumFromUint64Converter adapts checker type of Uint64Converter to the interface Uint64EnumConverter. If converter is nil it is return based on NoUint64Convert enum checker.
func EnumUint64ConverterSeries ¶
func EnumUint64ConverterSeries(converters ...Uint64EnumConverter) Uint64EnumConverter
EnumUint64ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Uint64EnumHandle ¶
Uint64EnumHandle is a shortcut implementation of Uint64EnumHandler based on a function.
type Uint64EnumHandler ¶
type Uint64EnumHandler interface { // Handle should do something with item of uint64 and its ordered number. // It is suggested to return EndOfUint64Iterator to stop iteration. Handle(int, uint64) error }
Uint64EnumHandler is an object handling an item type of uint64 and its ordered number.
func Uint64EnumHandlerSeries ¶
func Uint64EnumHandlerSeries(handlers ...Uint64EnumHandler) Uint64EnumHandler
Uint64EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Uint64EnumIterator ¶
type Uint64EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...Uint64EnumHandler) error }
Uint64EnumIterator is an iterator over items and their ordering numbers.
func MakeUint64EnumIterator ¶
func MakeUint64EnumIterator(maker Uint64IterMaker) Uint64EnumIterator
MakeUint64EnumIterator constructs an instance implementing Uint64EnumIterator based on Uint64IterMaker.
func ToUint64EnumIterator ¶
func ToUint64EnumIterator(iter Uint64Iterator) Uint64EnumIterator
ToUint64EnumIterator constructs an instance implementing Uint64EnumIterator based on Uint64Iterator.
type Uint64Handle ¶
Uint64Handle is a shortcut implementation of Uint64Handler based on a function.
func (Uint64Handle) Handle ¶
func (h Uint64Handle) Handle(item uint64) error
Handle does something with item of uint64. It is suggested to return EndOfUint64Iterator to stop iteration.
type Uint64Handler ¶
type Uint64Handler interface { // Handle should do something with item of uint64. // It is suggested to return EndOfUint64Iterator to stop iteration. Handle(uint64) error }
Uint64Handler is an object handling an item type of uint64.
var Uint64DoNothing Uint64Handler = Uint64Handle(func(_ uint64) error { return nil })
Uint64DoNothing does nothing.
func Uint64HandlerSeries ¶
func Uint64HandlerSeries(handlers ...Uint64Handler) Uint64Handler
Uint64HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Uint64IterMaker ¶
type Uint64IterMaker interface { // MakeIter should return a new instance of Uint64Iterator to iterate over it. MakeIter() Uint64Iterator }
Uint64IterMaker is a maker of Uint64Iterator.
var MakeNoUint64Iter Uint64IterMaker = MakeUint64Iter( func() Uint64Iterator { return EmptyUint64Iterator })
MakeNoUint64Iter is a zero value for Uint64IterMaker. It always returns EmptyUint64Iterator and an empty error.
type Uint64Iterator ¶
type Uint64Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() uint64 // Err contains first met error while Next. Err() error }
Uint64Iterator is an iterator over items type of uint64.
var EmptyUint64Iterator Uint64Iterator = emptyUint64Iterator{}
EmptyUint64Iterator is a zero value for Uint64Iterator. It is not contains any item to iterate over it.
func PriorUint64EnumIterator ¶ added in v0.0.4
func PriorUint64EnumIterator(comparer Uint64EnumComparer, itemList ...Uint64Iterator) Uint64Iterator
PriorUint64EnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorUint64Iterator ¶ added in v0.0.2
func PriorUint64Iterator(comparer Uint64Comparer, itemList ...Uint64Iterator) Uint64Iterator
PriorUint64Iterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperUint64Iterator ¶
func SuperUint64Iterator(itemList ...Uint64Iterator) Uint64Iterator
SuperUint64Iterator combines all iterators to one.
func Uint64Converting ¶
func Uint64Converting(items Uint64Iterator, converters ...Uint64Converter) Uint64Iterator
Uint64Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func Uint64DoingUntil ¶
func Uint64DoingUntil(items Uint64Iterator, untilList ...Uint64Checker) Uint64Iterator
Uint64DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Uint64EnumConverting ¶
func Uint64EnumConverting(items Uint64Iterator, converters ...Uint64EnumConverter) Uint64Iterator
Uint64EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func Uint64EnumDoingUntil ¶
func Uint64EnumDoingUntil(items Uint64Iterator, untilList ...Uint64EnumChecker) Uint64Iterator
Uint64EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Uint64EnumFiltering ¶
func Uint64EnumFiltering(items Uint64Iterator, filters ...Uint64EnumChecker) Uint64Iterator
Uint64EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func Uint64EnumHandling ¶
func Uint64EnumHandling(items Uint64Iterator, handlers ...Uint64EnumHandler) Uint64Iterator
Uint64EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Uint64Filtering ¶
func Uint64Filtering(items Uint64Iterator, filters ...Uint64Checker) Uint64Iterator
Uint64Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func Uint64GettingBatch ¶
func Uint64GettingBatch(items Uint64Iterator, batchSize int) Uint64Iterator
Uint64GettingBatch returns the next batch from items.
func Uint64Handling ¶
func Uint64Handling(items Uint64Iterator, handlers ...Uint64Handler) Uint64Iterator
Uint64Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func Uint64Invert ¶
func Uint64Invert(items Uint64Iterator) Uint64Iterator
Uint64Invert unrolls items and make inverting iterator based on them.
type Uint64RangeIterator ¶
type Uint64RangeIterator interface { // Range should iterate over items. Range(...Uint64Handler) error }
Uint64RangeIterator is an iterator over items.
func MakeUint64RangeIterator ¶
func MakeUint64RangeIterator(maker Uint64IterMaker) Uint64RangeIterator
MakeUint64RangeIterator constructs an instance implementing Uint64RangeIterator based on Uint64IterMaker.
func ToUint64RangeIterator ¶
func ToUint64RangeIterator(iter Uint64Iterator) Uint64RangeIterator
ToUint64RangeIterator constructs an instance implementing Uint64RangeIterator based on Uint64Iterator.
type Uint64Slice ¶
type Uint64Slice []uint64
Uint64Slice is a slice of uint64.
func Uint64Unroll ¶
func Uint64Unroll(items Uint64Iterator) Uint64Slice
Uint64Unroll unrolls items to slice of uint64.
func (Uint64Slice) MakeIter ¶
func (s Uint64Slice) MakeIter() Uint64Iterator
MakeIter returns a new instance of Uint64Iterator to iterate over it. It returns EmptyUint64Iterator if the error is not nil.
type Uint64SliceIterator ¶
type Uint64SliceIterator struct {
// contains filtered or unexported fields
}
Uint64SliceIterator is an iterator based on a slice of uint64.
func NewUint64SliceIterator ¶ added in v0.0.2
func NewUint64SliceIterator(slice []uint64) *Uint64SliceIterator
NewUint64SliceIterator returns a new instance of Uint64SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Uint64Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (Uint64SliceIterator) Err ¶
func (Uint64SliceIterator) Err() error
Err contains first met error while Next.
func (Uint64SliceIterator) HasNext ¶
func (it Uint64SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*Uint64SliceIterator) Next ¶
func (it *Uint64SliceIterator) Next() uint64
Next returns next item in the iterator. It should be invoked after check HasNext.
type Uint8Check ¶
Uint8Check is a shortcut implementation of Uint8Checker based on a function.
type Uint8Checker ¶
type Uint8Checker interface { // Check should check an item type of uint8 for some condition. // It is suggested to return EndOfUint8Iterator to stop iteration. Check(uint8) (bool, error) }
Uint8Checker is an object checking an item type of uint8 for some condition.
var ( // AlwaysUint8CheckTrue always returns true and empty error. AlwaysUint8CheckTrue Uint8Checker = Uint8Check( func(item uint8) (bool, error) { return true, nil }) // AlwaysUint8CheckFalse always returns false and empty error. AlwaysUint8CheckFalse Uint8Checker = Uint8Check( func(item uint8) (bool, error) { return false, nil }) )
func AllUint8 ¶
func AllUint8(checkers ...Uint8Checker) Uint8Checker
AllUint8 combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyUint8 ¶
func AnyUint8(checkers ...Uint8Checker) Uint8Checker
AnyUint8 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotUint8 ¶
func NotUint8(checker Uint8Checker) Uint8Checker
NotUint8 do an inversion for checker result. It is returns AlwaysUint8CheckTrue if checker is nil.
type Uint8Compare ¶ added in v0.0.2
Uint8Compare is a shortcut implementation of Uint8EnumComparer based on a function.
func (Uint8Compare) IsLess ¶ added in v0.0.2
func (c Uint8Compare) IsLess(lhs, rhs uint8) bool
IsLess is true if lhs is less than rhs.
type Uint8Comparer ¶ added in v0.0.2
type Uint8Comparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs uint8) bool }
Uint8EnumComparer is a strategy to compare two types.
var Uint8AlwaysLess Uint8Comparer = Uint8Compare(func(_, _ uint8) bool { return true })
EnumUint8AlwaysLess is an implementation of Uint8EnumComparer returning always true.
type Uint8Convert ¶
Uint8Convert is a shortcut implementation of Uint8Converter based on a function.
type Uint8Converter ¶
type Uint8Converter interface { // Convert should convert an item type of uint8 into another item of uint8. // It is suggested to return EndOfUint8Iterator to stop iteration. Convert(uint8) (uint8, error) }
Uint8Converter is an object converting an item type of uint8.
var NoUint8Convert Uint8Converter = Uint8Convert( func(item uint8) (uint8, error) { return item, nil })
NoUint8Convert does nothing with item, just returns it as is.
func Uint8ConverterSeries ¶
func Uint8ConverterSeries(converters ...Uint8Converter) Uint8Converter
Uint8ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Uint8EnumCheck ¶
Uint8EnumCheck is a shortcut implementation of Uint8EnumChecker based on a function.
type Uint8EnumChecker ¶
type Uint8EnumChecker interface { // Check checks an item type of uint8 and its ordering number for some condition. // It is suggested to return EndOfUint8Iterator to stop iteration. Check(int, uint8) (bool, error) }
Uint8EnumChecker is an object checking an item type of uint8 and its ordering number in for some condition.
func EnumAllUint8 ¶
func EnumAllUint8(checkers ...Uint8EnumChecker) Uint8EnumChecker
EnumAllUint8 combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyUint8 ¶
func EnumAnyUint8(checkers ...Uint8EnumChecker) Uint8EnumChecker
EnumAnyUint8 combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromUint8Checker ¶
func EnumFromUint8Checker(checker Uint8Checker) Uint8EnumChecker
EnumFromUint8Checker adapts checker type of Uint8Checker to the interface Uint8EnumChecker. If checker is nil it is return based on AlwaysUint8CheckFalse enum checker.
func EnumNotUint8 ¶
func EnumNotUint8(checker Uint8EnumChecker) Uint8EnumChecker
EnumNotUint8 do an inversion for checker result. It is returns AlwaysUint8EnumCheckTrue if checker is nil.
type Uint8EnumCompare ¶ added in v0.0.4
Uint8EnumCompare is a shortcut implementation of Uint8EnumComparer based on a function.
type Uint8EnumComparer ¶ added in v0.0.4
type Uint8EnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs uint8, nRHS int, rhs uint8) bool }
Uint8EnumComparer is a strategy to compare two types and their order numbers.
var EnumUint8AlwaysLess Uint8EnumComparer = Uint8EnumCompare( func(_ int, _ uint8, _ int, _ uint8) bool { return true })
EnumUint8AlwaysLess is an implementation of Uint8EnumComparer returning always true.
type Uint8EnumConvert ¶
Uint8EnumConvert is a shortcut implementation of Uint8EnumConverter based on a function.
type Uint8EnumConverter ¶
type Uint8EnumConverter interface { // Convert should convert an item type of uint8 into another item of uint8. // It is suggested to return EndOfUint8Iterator to stop iteration. Convert(n int, val uint8) (uint8, error) }
Uint8EnumConverter is an object converting an item type of uint8 and its ordering number.
var NoUint8EnumConvert Uint8EnumConverter = Uint8EnumConvert( func(_ int, item uint8) (uint8, error) { return item, nil })
NoUint8EnumConvert does nothing with item, just returns it as is.
func EnumFromUint8Converter ¶
func EnumFromUint8Converter(converter Uint8Converter) Uint8EnumConverter
EnumFromUint8Converter adapts checker type of Uint8Converter to the interface Uint8EnumConverter. If converter is nil it is return based on NoUint8Convert enum checker.
func EnumUint8ConverterSeries ¶
func EnumUint8ConverterSeries(converters ...Uint8EnumConverter) Uint8EnumConverter
EnumUint8ConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type Uint8EnumHandle ¶
Uint8EnumHandle is a shortcut implementation of Uint8EnumHandler based on a function.
type Uint8EnumHandler ¶
type Uint8EnumHandler interface { // Handle should do something with item of uint8 and its ordered number. // It is suggested to return EndOfUint8Iterator to stop iteration. Handle(int, uint8) error }
Uint8EnumHandler is an object handling an item type of uint8 and its ordered number.
func Uint8EnumHandlerSeries ¶
func Uint8EnumHandlerSeries(handlers ...Uint8EnumHandler) Uint8EnumHandler
Uint8EnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Uint8EnumIterator ¶
type Uint8EnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...Uint8EnumHandler) error }
Uint8EnumIterator is an iterator over items and their ordering numbers.
func MakeUint8EnumIterator ¶
func MakeUint8EnumIterator(maker Uint8IterMaker) Uint8EnumIterator
MakeUint8EnumIterator constructs an instance implementing Uint8EnumIterator based on Uint8IterMaker.
func ToUint8EnumIterator ¶
func ToUint8EnumIterator(iter Uint8Iterator) Uint8EnumIterator
ToUint8EnumIterator constructs an instance implementing Uint8EnumIterator based on Uint8Iterator.
type Uint8Handle ¶
Uint8Handle is a shortcut implementation of Uint8Handler based on a function.
func (Uint8Handle) Handle ¶
func (h Uint8Handle) Handle(item uint8) error
Handle does something with item of uint8. It is suggested to return EndOfUint8Iterator to stop iteration.
type Uint8Handler ¶
type Uint8Handler interface { // Handle should do something with item of uint8. // It is suggested to return EndOfUint8Iterator to stop iteration. Handle(uint8) error }
Uint8Handler is an object handling an item type of uint8.
var Uint8DoNothing Uint8Handler = Uint8Handle(func(_ uint8) error { return nil })
Uint8DoNothing does nothing.
func Uint8HandlerSeries ¶
func Uint8HandlerSeries(handlers ...Uint8Handler) Uint8Handler
Uint8HandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type Uint8IterMaker ¶
type Uint8IterMaker interface { // MakeIter should return a new instance of Uint8Iterator to iterate over it. MakeIter() Uint8Iterator }
Uint8IterMaker is a maker of Uint8Iterator.
var MakeNoUint8Iter Uint8IterMaker = MakeUint8Iter( func() Uint8Iterator { return EmptyUint8Iterator })
MakeNoUint8Iter is a zero value for Uint8IterMaker. It always returns EmptyUint8Iterator and an empty error.
type Uint8Iterator ¶
type Uint8Iterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() uint8 // Err contains first met error while Next. Err() error }
Uint8Iterator is an iterator over items type of uint8.
var EmptyUint8Iterator Uint8Iterator = emptyUint8Iterator{}
EmptyUint8Iterator is a zero value for Uint8Iterator. It is not contains any item to iterate over it.
func PriorUint8EnumIterator ¶ added in v0.0.4
func PriorUint8EnumIterator(comparer Uint8EnumComparer, itemList ...Uint8Iterator) Uint8Iterator
PriorUint8EnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorUint8Iterator ¶ added in v0.0.2
func PriorUint8Iterator(comparer Uint8Comparer, itemList ...Uint8Iterator) Uint8Iterator
PriorUint8Iterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperUint8Iterator ¶
func SuperUint8Iterator(itemList ...Uint8Iterator) Uint8Iterator
SuperUint8Iterator combines all iterators to one.
func Uint8Converting ¶
func Uint8Converting(items Uint8Iterator, converters ...Uint8Converter) Uint8Iterator
Uint8Converting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func Uint8DoingUntil ¶
func Uint8DoingUntil(items Uint8Iterator, untilList ...Uint8Checker) Uint8Iterator
Uint8DoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Uint8EnumConverting ¶
func Uint8EnumConverting(items Uint8Iterator, converters ...Uint8EnumConverter) Uint8Iterator
Uint8EnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func Uint8EnumDoingUntil ¶
func Uint8EnumDoingUntil(items Uint8Iterator, untilList ...Uint8EnumChecker) Uint8Iterator
Uint8EnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func Uint8EnumFiltering ¶
func Uint8EnumFiltering(items Uint8Iterator, filters ...Uint8EnumChecker) Uint8Iterator
Uint8EnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func Uint8EnumHandling ¶
func Uint8EnumHandling(items Uint8Iterator, handlers ...Uint8EnumHandler) Uint8Iterator
Uint8EnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func Uint8Filtering ¶
func Uint8Filtering(items Uint8Iterator, filters ...Uint8Checker) Uint8Iterator
Uint8Filtering sets filter while iterating over items. If filters is empty, so all items will return.
func Uint8GettingBatch ¶
func Uint8GettingBatch(items Uint8Iterator, batchSize int) Uint8Iterator
Uint8GettingBatch returns the next batch from items.
func Uint8Handling ¶
func Uint8Handling(items Uint8Iterator, handlers ...Uint8Handler) Uint8Iterator
Uint8Handling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func Uint8Invert ¶
func Uint8Invert(items Uint8Iterator) Uint8Iterator
Uint8Invert unrolls items and make inverting iterator based on them.
type Uint8RangeIterator ¶
type Uint8RangeIterator interface { // Range should iterate over items. Range(...Uint8Handler) error }
Uint8RangeIterator is an iterator over items.
func MakeUint8RangeIterator ¶
func MakeUint8RangeIterator(maker Uint8IterMaker) Uint8RangeIterator
MakeUint8RangeIterator constructs an instance implementing Uint8RangeIterator based on Uint8IterMaker.
func ToUint8RangeIterator ¶
func ToUint8RangeIterator(iter Uint8Iterator) Uint8RangeIterator
ToUint8RangeIterator constructs an instance implementing Uint8RangeIterator based on Uint8Iterator.
type Uint8Slice ¶
type Uint8Slice []uint8
Uint8Slice is a slice of uint8.
func Uint8Unroll ¶
func Uint8Unroll(items Uint8Iterator) Uint8Slice
Uint8Unroll unrolls items to slice of uint8.
func (Uint8Slice) MakeIter ¶
func (s Uint8Slice) MakeIter() Uint8Iterator
MakeIter returns a new instance of Uint8Iterator to iterate over it. It returns EmptyUint8Iterator if the error is not nil.
type Uint8SliceIterator ¶
type Uint8SliceIterator struct {
// contains filtered or unexported fields
}
Uint8SliceIterator is an iterator based on a slice of uint8.
func NewUint8SliceIterator ¶ added in v0.0.2
func NewUint8SliceIterator(slice []uint8) *Uint8SliceIterator
NewUint8SliceIterator returns a new instance of Uint8SliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use Uint8Unroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (Uint8SliceIterator) Err ¶
func (Uint8SliceIterator) Err() error
Err contains first met error while Next.
func (Uint8SliceIterator) HasNext ¶
func (it Uint8SliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*Uint8SliceIterator) Next ¶
func (it *Uint8SliceIterator) Next() uint8
Next returns next item in the iterator. It should be invoked after check HasNext.
type UintChecker ¶
type UintChecker interface { // Check should check an item type of uint for some condition. // It is suggested to return EndOfUintIterator to stop iteration. Check(uint) (bool, error) }
UintChecker is an object checking an item type of uint for some condition.
var ( // AlwaysUintCheckTrue always returns true and empty error. AlwaysUintCheckTrue UintChecker = UintCheck( func(item uint) (bool, error) { return true, nil }) // AlwaysUintCheckFalse always returns false and empty error. AlwaysUintCheckFalse UintChecker = UintCheck( func(item uint) (bool, error) { return false, nil }) )
func AllUint ¶
func AllUint(checkers ...UintChecker) UintChecker
AllUint combines all the given checkers to one checking if all checkers return true. It returns true checker if the list of checkers is empty.
func AnyUint ¶
func AnyUint(checkers ...UintChecker) UintChecker
AnyUint combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func NotUint ¶
func NotUint(checker UintChecker) UintChecker
NotUint do an inversion for checker result. It is returns AlwaysUintCheckTrue if checker is nil.
type UintCompare ¶ added in v0.0.2
UintCompare is a shortcut implementation of UintEnumComparer based on a function.
func (UintCompare) IsLess ¶ added in v0.0.2
func (c UintCompare) IsLess(lhs, rhs uint) bool
IsLess is true if lhs is less than rhs.
type UintComparer ¶ added in v0.0.2
type UintComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(lhs, rhs uint) bool }
UintEnumComparer is a strategy to compare two types.
var UintAlwaysLess UintComparer = UintCompare(func(_, _ uint) bool { return true })
EnumUintAlwaysLess is an implementation of UintEnumComparer returning always true.
type UintConvert ¶
UintConvert is a shortcut implementation of UintConverter based on a function.
type UintConverter ¶
type UintConverter interface { // Convert should convert an item type of uint into another item of uint. // It is suggested to return EndOfUintIterator to stop iteration. Convert(uint) (uint, error) }
UintConverter is an object converting an item type of uint.
var NoUintConvert UintConverter = UintConvert( func(item uint) (uint, error) { return item, nil })
NoUintConvert does nothing with item, just returns it as is.
func UintConverterSeries ¶
func UintConverterSeries(converters ...UintConverter) UintConverter
UintConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type UintEnumCheck ¶
UintEnumCheck is a shortcut implementation of UintEnumChecker based on a function.
type UintEnumChecker ¶
type UintEnumChecker interface { // Check checks an item type of uint and its ordering number for some condition. // It is suggested to return EndOfUintIterator to stop iteration. Check(int, uint) (bool, error) }
UintEnumChecker is an object checking an item type of uint and its ordering number in for some condition.
func EnumAllUint ¶
func EnumAllUint(checkers ...UintEnumChecker) UintEnumChecker
EnumAllUint combines all the given checkers to one checking if all checkers return true. It returns true if the list of checkers is empty.
func EnumAnyUint ¶
func EnumAnyUint(checkers ...UintEnumChecker) UintEnumChecker
EnumAnyUint combines all the given checkers to one. checking if any checker return true. It returns false if the list of checkers is empty.
func EnumFromUintChecker ¶
func EnumFromUintChecker(checker UintChecker) UintEnumChecker
EnumFromUintChecker adapts checker type of UintChecker to the interface UintEnumChecker. If checker is nil it is return based on AlwaysUintCheckFalse enum checker.
func EnumNotUint ¶
func EnumNotUint(checker UintEnumChecker) UintEnumChecker
EnumNotUint do an inversion for checker result. It is returns AlwaysUintEnumCheckTrue if checker is nil.
type UintEnumCompare ¶ added in v0.0.4
UintEnumCompare is a shortcut implementation of UintEnumComparer based on a function.
type UintEnumComparer ¶ added in v0.0.4
type UintEnumComparer interface { // IsLess should be true if lhs is less than rhs. IsLess(nLHS int, lhs uint, nRHS int, rhs uint) bool }
UintEnumComparer is a strategy to compare two types and their order numbers.
var EnumUintAlwaysLess UintEnumComparer = UintEnumCompare( func(_ int, _ uint, _ int, _ uint) bool { return true })
EnumUintAlwaysLess is an implementation of UintEnumComparer returning always true.
type UintEnumConvert ¶
UintEnumConvert is a shortcut implementation of UintEnumConverter based on a function.
type UintEnumConverter ¶
type UintEnumConverter interface { // Convert should convert an item type of uint into another item of uint. // It is suggested to return EndOfUintIterator to stop iteration. Convert(n int, val uint) (uint, error) }
UintEnumConverter is an object converting an item type of uint and its ordering number.
var NoUintEnumConvert UintEnumConverter = UintEnumConvert( func(_ int, item uint) (uint, error) { return item, nil })
NoUintEnumConvert does nothing with item, just returns it as is.
func EnumFromUintConverter ¶
func EnumFromUintConverter(converter UintConverter) UintEnumConverter
EnumFromUintConverter adapts checker type of UintConverter to the interface UintEnumConverter. If converter is nil it is return based on NoUintConvert enum checker.
func EnumUintConverterSeries ¶
func EnumUintConverterSeries(converters ...UintEnumConverter) UintEnumConverter
EnumUintConverterSeries combines all the given converters to sequenced one It returns no converter if the list of converters is empty.
type UintEnumHandle ¶
UintEnumHandle is a shortcut implementation of UintEnumHandler based on a function.
type UintEnumHandler ¶
type UintEnumHandler interface { // Handle should do something with item of uint and its ordered number. // It is suggested to return EndOfUintIterator to stop iteration. Handle(int, uint) error }
UintEnumHandler is an object handling an item type of uint and its ordered number.
func UintEnumHandlerSeries ¶
func UintEnumHandlerSeries(handlers ...UintEnumHandler) UintEnumHandler
UintEnumHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type UintEnumIterator ¶
type UintEnumIterator interface { // Enum should iterate over items and their ordering numbers. Enum(...UintEnumHandler) error }
UintEnumIterator is an iterator over items and their ordering numbers.
func MakeUintEnumIterator ¶
func MakeUintEnumIterator(maker UintIterMaker) UintEnumIterator
MakeUintEnumIterator constructs an instance implementing UintEnumIterator based on UintIterMaker.
func ToUintEnumIterator ¶
func ToUintEnumIterator(iter UintIterator) UintEnumIterator
ToUintEnumIterator constructs an instance implementing UintEnumIterator based on UintIterator.
type UintHandle ¶
UintHandle is a shortcut implementation of UintHandler based on a function.
func (UintHandle) Handle ¶
func (h UintHandle) Handle(item uint) error
Handle does something with item of uint. It is suggested to return EndOfUintIterator to stop iteration.
type UintHandler ¶
type UintHandler interface { // Handle should do something with item of uint. // It is suggested to return EndOfUintIterator to stop iteration. Handle(uint) error }
UintHandler is an object handling an item type of uint.
var UintDoNothing UintHandler = UintHandle(func(_ uint) error { return nil })
UintDoNothing does nothing.
func UintHandlerSeries ¶
func UintHandlerSeries(handlers ...UintHandler) UintHandler
UintHandlerSeries combines all the given handlers to sequenced one It returns do nothing handler if the list of handlers is empty.
type UintIterMaker ¶
type UintIterMaker interface { // MakeIter should return a new instance of UintIterator to iterate over it. MakeIter() UintIterator }
UintIterMaker is a maker of UintIterator.
var MakeNoUintIter UintIterMaker = MakeUintIter( func() UintIterator { return EmptyUintIterator })
MakeNoUintIter is a zero value for UintIterMaker. It always returns EmptyUintIterator and an empty error.
type UintIterator ¶
type UintIterator interface { // HasNext checks if there is the next item // in the iterator. HasNext should be idempotent. HasNext() bool // Next should return next item in the iterator. // It should be invoked after check HasNext. Next() uint // Err contains first met error while Next. Err() error }
UintIterator is an iterator over items type of uint.
var EmptyUintIterator UintIterator = emptyUintIterator{}
EmptyUintIterator is a zero value for UintIterator. It is not contains any item to iterate over it.
func PriorUintEnumIterator ¶ added in v0.0.4
func PriorUintEnumIterator(comparer UintEnumComparer, itemList ...UintIterator) UintIterator
PriorUintEnumIterator compare one by one items and their ordering numbers fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func PriorUintIterator ¶ added in v0.0.2
func PriorUintIterator(comparer UintComparer, itemList ...UintIterator) UintIterator
PriorUintIterator compare one by one items fetched from all iterators and choose smallest from them to return as next. If comparer is nil so more left iterator is considered had smallest item. It is recommended to use the iterator to order already ordered iterators.
func SuperUintIterator ¶
func SuperUintIterator(itemList ...UintIterator) UintIterator
SuperUintIterator combines all iterators to one.
func UintConverting ¶
func UintConverting(items UintIterator, converters ...UintConverter) UintIterator
UintConverting sets converter while iterating over items. If converters is empty, so all items will not be affected.
func UintDoingUntil ¶
func UintDoingUntil(items UintIterator, untilList ...UintChecker) UintIterator
UintDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func UintEnumConverting ¶
func UintEnumConverting(items UintIterator, converters ...UintEnumConverter) UintIterator
UintEnumConverting sets converter while iterating over items and their ordering numbers. If converters is empty, so all items will not be affected.
func UintEnumDoingUntil ¶
func UintEnumDoingUntil(items UintIterator, untilList ...UintEnumChecker) UintIterator
UintEnumDoingUntil sets until checker while iterating over items. If untilList is empty, so all items returned as is.
func UintEnumFiltering ¶
func UintEnumFiltering(items UintIterator, filters ...UintEnumChecker) UintIterator
UintEnumFiltering sets filter while iterating over items and their serial numbers. If filters is empty, so all items will return.
func UintEnumHandling ¶
func UintEnumHandling(items UintIterator, handlers ...UintEnumHandler) UintIterator
UintEnumHandling sets handler while iterating over items with their serial number. If handlers is empty, so it will do nothing.
func UintFiltering ¶
func UintFiltering(items UintIterator, filters ...UintChecker) UintIterator
UintFiltering sets filter while iterating over items. If filters is empty, so all items will return.
func UintGettingBatch ¶
func UintGettingBatch(items UintIterator, batchSize int) UintIterator
UintGettingBatch returns the next batch from items.
func UintHandling ¶
func UintHandling(items UintIterator, handlers ...UintHandler) UintIterator
UintHandling sets handler while iterating over items. If handlers is empty, so it will do nothing.
func UintInvert ¶
func UintInvert(items UintIterator) UintIterator
UintInvert unrolls items and make inverting iterator based on them.
type UintRangeIterator ¶
type UintRangeIterator interface { // Range should iterate over items. Range(...UintHandler) error }
UintRangeIterator is an iterator over items.
func MakeUintRangeIterator ¶
func MakeUintRangeIterator(maker UintIterMaker) UintRangeIterator
MakeUintRangeIterator constructs an instance implementing UintRangeIterator based on UintIterMaker.
func ToUintRangeIterator ¶
func ToUintRangeIterator(iter UintIterator) UintRangeIterator
ToUintRangeIterator constructs an instance implementing UintRangeIterator based on UintIterator.
type UintSlice ¶
type UintSlice []uint
UintSlice is a slice of uint.
func UintUnroll ¶
func UintUnroll(items UintIterator) UintSlice
UintUnroll unrolls items to slice of uint.
func (UintSlice) MakeIter ¶
func (s UintSlice) MakeIter() UintIterator
MakeIter returns a new instance of UintIterator to iterate over it. It returns EmptyUintIterator if the error is not nil.
type UintSliceIterator ¶
type UintSliceIterator struct {
// contains filtered or unexported fields
}
UintSliceIterator is an iterator based on a slice of uint.
func NewUintSliceIterator ¶ added in v0.0.2
func NewUintSliceIterator(slice []uint) *UintSliceIterator
NewUintSliceIterator returns a new instance of UintSliceIterator. Note: any changes in slice will affect correspond items in the iterator. Use UintUnroll(slice).MakeIter() instead of to iterate over copies of item in the items.
func (UintSliceIterator) Err ¶
func (UintSliceIterator) Err() error
Err contains first met error while Next.
func (UintSliceIterator) HasNext ¶
func (it UintSliceIterator) HasNext() bool
HasNext checks if there is the next item in the iterator. HasNext is idempotent.
func (*UintSliceIterator) Next ¶
func (it *UintSliceIterator) Next() uint
Next returns next item in the iterator. It should be invoked after check HasNext.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
app/with_formatting
TODO the logic into go text templates
|
TODO the logic into go text templates |