Documentation ¶
Overview ¶
Package gstream Author: hyphen Copyright 2023 hyphen. All rights reserved. Create-time: 2023/12/21
Package gstream Author: hyphen Copyright 2023 hyphen. All rights reserved. Create-time: 2023/12/11
Package gstream Author: hyphen Copyright 2023 hyphen. All rights reserved. Create-time: 2023/12/11
Index ¶
- type MapStream
- func (m *MapStream[K, V]) Collect() map[K]V
- func (m *MapStream[K, V]) Convert(fc func(K, V) (K, V)) *MapStream[K, V]
- func (m *MapStream[K, V]) Filter(fc func(K, V) bool) *MapStream[K, V]
- func (m *MapStream[K, V]) ForEach(fc func(K, V)) *MapStream[K, V]
- func (m *MapStream[K, V]) Limit(n int) *MapStream[K, V]
- type SliceStream
- func (s *SliceStream[T]) Collect() []T
- func (s *SliceStream[T]) Convert(fc func(T) T) *SliceStream[T]
- func (s *SliceStream[T]) Count() int
- func (s *SliceStream[T]) Filter(fc func(T) bool) *SliceStream[T]
- func (s *SliceStream[T]) ForEach(fc func(T)) *SliceStream[T]
- func (s *SliceStream[T]) Map(fc func(T) T) *SliceStream[T]
- func (s *SliceStream[T]) Sort(less func(t1, t2 T) bool) *SliceStream[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapStream ¶
type MapStream[K comparable, V any] struct { // contains filtered or unexported fields }
func AsMapStream ¶
func AsMapStream[K comparable, V any, M ~map[K]V](m M) *MapStream[K, V]
func ToMapStream ¶
func ToMapStream[K comparable, T, V any](s *SliceStream[T], fc func(T) (K, V)) *MapStream[K, V]
func ToOtherMapStream ¶
func ToOtherMapStream[K1, K2 comparable, V1, V2 any](m *MapStream[K1, V1], fc func(K1, V1) (K2, V2)) *MapStream[K2, V2]
type SliceStream ¶
type SliceStream[T any] struct { // contains filtered or unexported fields }
func AsSliceStream ¶
func AsSliceStream[T any](s []T) *SliceStream[T]
func ToOtherSliceStream ¶
func ToOtherSliceStream[T1, T2 any](s *SliceStream[T1], fc func(T1) T2) *SliceStream[T2]
func ToSliceStream ¶
func ToSliceStream[K comparable, T, V any](m *MapStream[K, V], fc func(K, V) T) *SliceStream[T]
func (*SliceStream[T]) Collect ¶
func (s *SliceStream[T]) Collect() []T
func (*SliceStream[T]) Convert ¶
func (s *SliceStream[T]) Convert(fc func(T) T) *SliceStream[T]
Convert AKA: Map
func (*SliceStream[T]) Count ¶
func (s *SliceStream[T]) Count() int
func (*SliceStream[T]) Filter ¶
func (s *SliceStream[T]) Filter(fc func(T) bool) *SliceStream[T]
func (*SliceStream[T]) ForEach ¶
func (s *SliceStream[T]) ForEach(fc func(T)) *SliceStream[T]
func (*SliceStream[T]) Map ¶
func (s *SliceStream[T]) Map(fc func(T) T) *SliceStream[T]
Map an alias of [Convert]
func (*SliceStream[T]) Sort ¶
func (s *SliceStream[T]) Sort(less func(t1, t2 T) bool) *SliceStream[T]
Click to show internal directories.
Click to hide internal directories.