grouper

package
v0.52.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicGrouper

type BasicGrouper[T any, K comparable] struct {
	GroupingFunc func(input T) K
}

BasicGrouper implements Grouper

func NewBasicGrouper

func NewBasicGrouper[T any, K comparable](groupingFunction func(input T) K) *BasicGrouper[T, K]

func (*BasicGrouper[T, K]) Group

func (b *BasicGrouper[T, K]) Group(input []T) map[K][]T

type Grouper

type Grouper[T any, K comparable] interface {
	Group(input []T) map[K][]T
}

Grouper is a base type to split the source group into named list of results.

Jump to

Keyboard shortcuts

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