user

package
v0.0.0-...-a59babc Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	Name string
	Age  int
}

User is a user model.

type UserAccumulator

type UserAccumulator interface{}

type UserByAgeCount

type UserByAgeCount map[string]int

type UserSlice

type UserSlice []User

UserSlice is a slice of User that bar.

func (UserSlice) GroupBy

func (t UserSlice) GroupBy(groupBy func(User) string) map[string]UserSlice

GroupBy returns a map of string keys to UserSlice using the provided groupBy fn.

func (UserSlice) Map

func (t UserSlice) Map(fn func(User) User) UserSlice

Map calls the provided func for each element in t and returns a new UserSlice.

func (UserSlice) Reduce

func (t UserSlice) Reduce(accumulator func(UserAccumulator, User) UserAccumulator, initial UserAccumulator) UserAccumulator

Jump to

Keyboard shortcuts

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