Documentation ¶
Index ¶
- func Count() collector
- func CountV2() collectorV2
- func GroupBy(typ interface{}, classifier normalizedFn, downstream collector) collector
- func GroupByV2(typ interface{}, classifier normalizedFn, downstream collectorV2) collectorV2
- func ToMap(typ interface{}, keyMapper, valueMapper normalizedFn) collector
- func ToMapV2(typ interface{}, keyMapper, valueMapper normalizedFn) collectorV2
- func ToSlice(typ interface{}) collector
- func ToSliceBy(typ interface{}, mapper normalizedFn) collector
- func ToSliceByV2(typ interface{}, mapper normalizedFn) collectorV2
- func ToSliceV2(typ interface{}) collectorV2
- type KeyValue
- type Stream
- func (s Stream) All(predicate func(interface{}) bool) bool
- func (s Stream) Any() bool
- func (s Stream) AnyWith(predicate func(interface{}) bool) bool
- func (s Stream) Collect(c collector) interface{}
- func (s Stream) CollectV2(c collectorV2) interface{}
- func (s Stream) Contains(value interface{}) bool
- func (s Stream) Count() int
- func (s Stream) Drop(n int) Stream
- func (s Stream) Filter(predicate func(interface{}) bool) Stream
- func (s Stream) First() (interface{}, bool)
- func (s Stream) FlatMap(mapper func(interface{}) Stream) Stream
- func (s Stream) ForEach(action func(interface{}))
- func (s Stream) ForEachIndexed(action func(int, interface{}))
- func (s Stream) Last() (interface{}, bool)
- func (s Stream) Limit(n int) Stream
- func (s Stream) Linq() linq.Query
- func (s Stream) Map(mapper normalizedFn) Stream
- func (s Stream) OutMap(out interface{})
- func (s Stream) OutSlice(out interface{})
- func (s Stream) Partition(typ interface{}, size int) Stream
- func (s Stream) Peek(fn func(interface{})) Stream
- func (s Stream) Process(fn func(interface{}) error) error
- func (s Stream) Reduce(accumulator accumulatorFn) interface{}
- func (s Stream) ReduceWith(seed interface{}, accumulator accumulatorFn) interface{}
- func (s Stream) SortedBy(fn normalizedFn) Stream
- func (s Stream) SortedDescBy(fn normalizedFn) Stream
- func (s Stream) ToMap(typ interface{}) interface{}
- func (s Stream) ToSlice(typ interface{}) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GroupBy ¶
func GroupBy(typ interface{}, classifier normalizedFn, downstream collector) collector
GroupBy 分组收集器,将item分组收集。 参数说明:
classifier 分组函数 downstream 下游收集器
func GroupByV2 ¶
func GroupByV2(typ interface{}, classifier normalizedFn, downstream collectorV2) collectorV2
GroupByV2 ...
func ToMapV2 ¶
func ToMapV2(typ interface{}, keyMapper, valueMapper normalizedFn) collectorV2
ToMapV2 ...
func ToSlice ¶
func ToSlice(typ interface{}) collector
ToSlice 收集器,将item收集为slice。 typ为类型参数,允许为nil。 eg: []int{} or []int(nil)
func ToSliceBy ¶
func ToSliceBy(typ interface{}, mapper normalizedFn) collector
ToSliceBy 收集器,将mapper应用于每一个item,再收集结果
func ToSliceByV2 ¶
func ToSliceByV2(typ interface{}, mapper normalizedFn) collectorV2
ToSliceByV2 ...
Types ¶
type Stream ¶
type Stream linq.Query
Stream 流
func (Stream) CollectV2 ¶
func (s Stream) CollectV2(c collectorV2) interface{}
CollectV2 Collect的v2版本,基于go-linq实现
func (Stream) ForEachIndexed ¶
ForEachIndexed 带index遍历item
func (Stream) ReduceWith ¶
func (s Stream) ReduceWith(seed interface{}, accumulator accumulatorFn) interface{}
ReduceWith ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.