Documentation
¶
Index ¶
- Variables
- func AggregateSelect[T, S any](src []T, initialF func(T) S, f func(S, T) S) S
- func AggregateSelectWithIndex[T, S any](src []T, initialF func(T) S, f func(S, T, int) S) S
- func All[T any](src []T, a func(T) bool) bool
- func Any[T any](src []T, a func(T) bool) bool
- func Chunk[T any](src []T, size int) [][]T
- func ChunkWithErr[T any](src []T, size int) ([][]T, error)
- func Contains[T comparable](src []T, e T) bool
- func Distinct[T comparable](src []T) []T
- func DistinctBy[T any, K comparable](src []T, d func(T) K) []T
- func DistinctByWithErr[T any, K comparable](src []T, d func(T) K) ([]T, error)
- func Filters[T any](src []T, fs ...func(T) bool) ([][]T, []T)
- func FirstOrDefault[T any](src []T) T
- func GroupBy[K comparable, T any](src []T, k func(T) K) map[K][]T
- func GroupByWithErr[K comparable, T any](src []T, k func(T) K) (map[K][]T, error)
- func LastOrDefault[T any](src []T) T
- func MaxBy[T any, S cmp.Ordered](src []T, m func(T) S) T
- func MaxByWithErr[T any, S cmp.Ordered](src []T, m func(T) S) (T, error)
- func MinBy[T any, S cmp.Ordered](src []T, m func(T) S) T
- func MinByWithErr[T any, S cmp.Ordered](src []T, m func(T) S) (T, error)
- func OrderBy[T any, S cmp.Ordered](src []T, o func(T) S) []T
- func OrderByDescending[T any, S cmp.Ordered](src []T, o func(T) S) []T
- func OrderByDescendingWithErr[T any, S cmp.Ordered](src []T, o func(T) S) ([]T, error)
- func OrderByWithErr[T any, S cmp.Ordered](src []T, o func(T) S) ([]T, error)
- func Select[T, S any](src []T, s func(T) S) []S
- func SelectMany[T, S any](src []T, s func(T) []S) []S
- func SelectWithErr[T, S any](src []T, s func(T) S) ([]S, error)
- func Sort[T any](src []T, cmps ...func(t1 T, t2 T) bool) []T
- func Sum[T any, S number](src []T, s func(T) S) S
- func SumWithErr[T any, S number](src []T, s func(T) S) (S, error)
- func Switch[T any](src []T, fs ...func(T) bool) ([][]T, []T)
- func ToMap[K comparable, T any](src []T, k func(T) K) map[K]T
- func ToMapWithErr[K comparable, T any](src []T, k func(T) K) (map[K]T, error)
- func Where[T any](src []T, w func(T) bool) []T
- func WhereSelect[T, S any](src []T, w func(T) bool, s func(T) S) []S
- func WhereSelectWithErr[T, S any](src []T, w func(T) bool, s func(T) S) ([]S, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrArg error = errors.New("argument error")
View Source
var ErrDuplicateKeyValue error = errors.New("duplicate key value error")
Functions ¶
func AggregateSelect ¶
func AggregateSelect[T, S any](src []T, initialF func(T) S, f func(S, T) S) S
func ChunkWithErr ¶
func Contains ¶
func Contains[T comparable](src []T, e T) bool
func Distinct ¶
func Distinct[T comparable](src []T) []T
func DistinctBy ¶
func DistinctBy[T any, K comparable](src []T, d func(T) K) []T
func DistinctByWithErr ¶
func DistinctByWithErr[T any, K comparable](src []T, d func(T) K) ([]T, error)
func FirstOrDefault ¶
func FirstOrDefault[T any](src []T) T
func GroupBy ¶
func GroupBy[K comparable, T any](src []T, k func(T) K) map[K][]T
func GroupByWithErr ¶
func GroupByWithErr[K comparable, T any](src []T, k func(T) K) (map[K][]T, error)
func LastOrDefault ¶
func LastOrDefault[T any](src []T) T
func OrderByDescending ¶
func SelectMany ¶
func SelectMany[T, S any](src []T, s func(T) []S) []S
func SelectWithErr ¶
func SumWithErr ¶
func ToMap ¶
func ToMap[K comparable, T any](src []T, k func(T) K) map[K]T
func ToMapWithErr ¶
func ToMapWithErr[K comparable, T any](src []T, k func(T) K) (map[K]T, error)
func WhereSelect ¶
func WhereSelectWithErr ¶
Types ¶
This section is empty.
Source Files
¶
- aggregate_select.go
- aggregate_select_with_index.go
- all.go
- any.go
- chunk.go
- chunk_with_err.go
- const.go
- contains.go
- distinct.go
- distinct_by.go
- distinct_by_with_err.go
- filters.go
- first_or_default.go
- group_by.go
- group_by_with_err.go
- last_or_default.go
- max_by.go
- max_by_with_err.go
- min_by.go
- min_by_with_err.go
- order_by.go
- order_by_descending.go
- order_by_descending_with_err.go
- order_by_with_err.go
- select.go
- select_many.go
- select_with_err.go
- sort.go
- sum.go
- sum_with_err.go
- switch.go
- to_map.go
- to_map_with_err.go
- where.go
- where_select.go
- where_select_with_err.go
Click to show internal directories.
Click to hide internal directories.