Documentation ¶
Index ¶
- type Thing1
- type Thing1s
- func (rcv Thing1s) AggregateInt(fn func(int, Thing1) int) (result int)
- func (rcv Thing1s) AggregateString(fn func(string, Thing1) string) (result string)
- func (rcv Thing1s) AggregateThing2(fn func(Thing2, Thing1) Thing2) (result Thing2)
- func (rcv Thing1s) All(fn func(Thing1) bool) bool
- func (rcv Thing1s) Any(fn func(Thing1) bool) bool
- func (rcv Thing1s) AverageInt(fn func(Thing1) int) (result int, err error)
- func (rcv Thing1s) AverageThing2(fn func(Thing1) Thing2) (result Thing2, err error)
- func (rcv Thing1s) Count(fn func(Thing1) bool) (result int)
- func (rcv Thing1s) Distinct() (result Thing1s)
- func (rcv Thing1s) DistinctBy(equal func(Thing1, Thing1) bool) (result Thing1s)
- func (rcv Thing1s) Each(fn func(Thing1))
- func (rcv Thing1s) First(fn func(Thing1) bool) (result Thing1, err error)
- func (rcv Thing1s) GroupByInt(fn func(Thing1) int) map[int]Thing1s
- func (rcv Thing1s) GroupByString(fn func(Thing1) string) map[string]Thing1s
- func (rcv Thing1s) GroupByThing2(fn func(Thing1) Thing2) map[Thing2]Thing1s
- func (rcv Thing1s) IsSortedBy(less func(Thing1, Thing1) bool) bool
- func (rcv Thing1s) IsSortedByDesc(less func(Thing1, Thing1) bool) bool
- func (rcv Thing1s) MaxBy(less func(Thing1, Thing1) bool) (result Thing1, err error)
- func (rcv Thing1s) MaxInt(fn func(Thing1) int) (result int, err error)
- func (rcv Thing1s) MaxString(fn func(Thing1) string) (result string, err error)
- func (rcv Thing1s) MaxThing2(fn func(Thing1) Thing2) (result Thing2, err error)
- func (rcv Thing1s) MinBy(less func(Thing1, Thing1) bool) (result Thing1, err error)
- func (rcv Thing1s) MinInt(fn func(Thing1) int) (result int, err error)
- func (rcv Thing1s) MinString(fn func(Thing1) string) (result string, err error)
- func (rcv Thing1s) MinThing2(fn func(Thing1) Thing2) (result Thing2, err error)
- func (rcv Thing1s) SelectInt(fn func(Thing1) int) (result []int)
- func (rcv Thing1s) SelectString(fn func(Thing1) string) (result []string)
- func (rcv Thing1s) SelectThing2(fn func(Thing1) Thing2) (result []Thing2)
- func (rcv Thing1s) Single(fn func(Thing1) bool) (result Thing1, err error)
- func (rcv Thing1s) SortBy(less func(Thing1, Thing1) bool) Thing1s
- func (rcv Thing1s) SortByDesc(less func(Thing1, Thing1) bool) Thing1s
- func (rcv Thing1s) SumInt(fn func(Thing1) int) (result int)
- func (rcv Thing1s) SumThing2(fn func(Thing1) Thing2) (result Thing2)
- func (rcv Thing1s) Where(fn func(Thing1) bool) (result Thing1s)
- type Thing2
- type Thing2s
- func (rcv Thing2s) IsSorted() bool
- func (rcv Thing2s) IsSortedDesc() bool
- func (rcv Thing2s) Len() int
- func (rcv Thing2s) Less(i, j int) bool
- func (rcv Thing2s) Max() (result Thing2, err error)
- func (rcv Thing2s) Min() (result Thing2, err error)
- func (rcv Thing2s) Sort() Thing2s
- func (rcv Thing2s) SortDesc() Thing2s
- func (rcv Thing2s) Swap(i, j int)
- type Thing3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Thing1s ¶
type Thing1s []Thing1
Thing1s is a slice of type Thing1, for use with gen methods below. Use this type where you would use []Thing1. (This is required because slices cannot be method receivers.)
func (Thing1s) AggregateInt ¶
AggregateInt iterates over Thing1s, operating on each element while maintaining ‘state’. See: http://clipperhouse.github.io/gen/#Aggregate
func (Thing1s) AggregateString ¶
AggregateString iterates over Thing1s, operating on each element while maintaining ‘state’. See: http://clipperhouse.github.io/gen/#Aggregate
func (Thing1s) AggregateThing2 ¶
AggregateThing2 iterates over Thing1s, operating on each element while maintaining ‘state’. See: http://clipperhouse.github.io/gen/#Aggregate
func (Thing1s) All ¶
All verifies that all elements of Thing1s return true for the passed func. See: http://clipperhouse.github.io/gen/#All
func (Thing1s) Any ¶
Any verifies that one or more elements of Thing1s return true for the passed func. See: http://clipperhouse.github.io/gen/#Any
func (Thing1s) AverageInt ¶
AverageInt sums int over all elements and divides by len(Thing1s). See: http://clipperhouse.github.io/gen/#Average
func (Thing1s) AverageThing2 ¶
AverageThing2 sums Thing2 over all elements and divides by len(Thing1s). See: http://clipperhouse.github.io/gen/#Average
func (Thing1s) Count ¶
Count gives the number elements of Thing1s that return true for the passed func. See: http://clipperhouse.github.io/gen/#Count
func (Thing1s) Distinct ¶
Distinct returns a new Thing1s slice whose elements are unique. See: http://clipperhouse.github.io/gen/#Distinct
func (Thing1s) DistinctBy ¶
DistinctBy returns a new Thing1s slice whose elements are unique, where equality is defined by a passed func. See: http://clipperhouse.github.io/gen/#DistinctBy
func (Thing1s) Each ¶
Each iterates over Thing1s and executes the passed func against each element. See: http://clipperhouse.github.io/gen/#Each
func (Thing1s) First ¶
First returns the first element that returns true for the passed func. Returns error if no elements return true. See: http://clipperhouse.github.io/gen/#First
func (Thing1s) GroupByInt ¶
GroupByInt groups elements into a map keyed by int. See: http://clipperhouse.github.io/gen/#GroupBy
func (Thing1s) GroupByString ¶
GroupByString groups elements into a map keyed by string. See: http://clipperhouse.github.io/gen/#GroupBy
func (Thing1s) GroupByThing2 ¶
GroupByThing2 groups elements into a map keyed by Thing2. See: http://clipperhouse.github.io/gen/#GroupBy
func (Thing1s) IsSortedBy ¶
IsSortedBy reports whether an instance of Thing1s is sorted, using the pass func to define ‘less’. See: http://clipperhouse.github.io/gen/#SortBy
func (Thing1s) IsSortedByDesc ¶
IsSortedDesc reports whether an instance of Thing1s is sorted in descending order, using the pass func to define ‘less’. See: http://clipperhouse.github.io/gen/#SortBy
func (Thing1s) MaxBy ¶
MaxBy returns an element of Thing1s containing the maximum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally maximal, the last such element is returned. Returns error if no elements. See: http://clipperhouse.github.io/gen/#MaxBy
func (Thing1s) MaxInt ¶
MaxInt selects the largest value of int in Thing1s. Returns error on Thing1s with no elements. See: http://clipperhouse.github.io/gen/#MaxCustom
func (Thing1s) MaxString ¶
MaxString selects the largest value of string in Thing1s. Returns error on Thing1s with no elements. See: http://clipperhouse.github.io/gen/#MaxCustom
func (Thing1s) MaxThing2 ¶
MaxThing2 selects the largest value of Thing2 in Thing1s. Returns error on Thing1s with no elements. See: http://clipperhouse.github.io/gen/#MaxCustom
func (Thing1s) MinBy ¶
MinBy returns an element of Thing1s containing the minimum value, when compared to other elements using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such element is returned. Returns error if no elements. See: http://clipperhouse.github.io/gen/#MinBy
func (Thing1s) MinInt ¶
MinInt selects the least value of int in Thing1s. Returns error on Thing1s with no elements. See: http://clipperhouse.github.io/gen/#MinCustom
func (Thing1s) MinString ¶
MinString selects the least value of string in Thing1s. Returns error on Thing1s with no elements. See: http://clipperhouse.github.io/gen/#MinCustom
func (Thing1s) MinThing2 ¶
MinThing2 selects the least value of Thing2 in Thing1s. Returns error on Thing1s with no elements. See: http://clipperhouse.github.io/gen/#MinCustom
func (Thing1s) SelectInt ¶
SelectInt returns a slice of int in Thing1s, projected by passed func. See: http://clipperhouse.github.io/gen/#Select
func (Thing1s) SelectString ¶
SelectString returns a slice of string in Thing1s, projected by passed func. See: http://clipperhouse.github.io/gen/#Select
func (Thing1s) SelectThing2 ¶
SelectThing2 returns a slice of Thing2 in Thing1s, projected by passed func. See: http://clipperhouse.github.io/gen/#Select
func (Thing1s) Single ¶
Single returns exactly one element of Thing1s that returns true for the passed func. Returns error if no or multiple elements return true. See: http://clipperhouse.github.io/gen/#Single
func (Thing1s) SortBy ¶
SortBy returns a new ordered Thing1s slice, determined by a func defining ‘less’. See: http://clipperhouse.github.io/gen/#SortBy
func (Thing1s) SortByDesc ¶
SortByDesc returns a new, descending-ordered Thing1s slice, determined by a func defining ‘less’. See: http://clipperhouse.github.io/gen/#SortBy
func (Thing1s) SumInt ¶
SumInt sums int over elements in Thing1s. See: http://clipperhouse.github.io/gen/#Sum
func (Thing1s) SumThing2 ¶
SumThing2 sums Thing2 over elements in Thing1s. See: http://clipperhouse.github.io/gen/#Sum
type Thing2s ¶
type Thing2s []Thing2
Thing2s is a slice of type Thing2, for use with gen methods below. Use this type where you would use []Thing2. (This is required because slices cannot be method receivers.)
func (Thing2s) IsSorted ¶
IsSorted reports whether Thing2s is sorted. See: http://clipperhouse.github.io/gen/#Sort
func (Thing2s) IsSortedDesc ¶
IsSortedDesc reports whether Thing2s is reverse-sorted. See: http://clipperhouse.github.io/gen/#Sort
func (Thing2s) Max ¶
Max returns the maximum value of Thing2s. In the case of multiple items being equally maximal, the first such element is returned. Returns error if no elements. See: http://clipperhouse.github.io/gen/#Max
func (Thing2s) Min ¶
Min returns the minimum value of Thing2s. In the case of multiple items being equally minimal, the first such element is returned. Returns error if no elements. See: http://clipperhouse.github.io/gen/#Min
func (Thing2s) Sort ¶
Sort returns a new ordered Thing2s slice. See: http://clipperhouse.github.io/gen/#Sort
func (Thing2s) SortDesc ¶
SortDesc returns a new reverse-ordered Thing2s slice. See: http://clipperhouse.github.io/gen/#Sort