models

package
v0.0.0-...-8462381 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2014 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Thing1

type Thing1 struct {
	Name   string
	Number int
}

+gen projections:"int,Thing2,string"

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

func (rcv Thing1s) AggregateInt(fn func(int, Thing1) int) (result int)

AggregateInt iterates over Thing1s, operating on each element while maintaining ‘state’. See: http://clipperhouse.github.io/gen/#Aggregate

func (Thing1s) AggregateString

func (rcv Thing1s) AggregateString(fn func(string, Thing1) string) (result string)

AggregateString iterates over Thing1s, operating on each element while maintaining ‘state’. See: http://clipperhouse.github.io/gen/#Aggregate

func (Thing1s) AggregateThing2

func (rcv Thing1s) AggregateThing2(fn func(Thing2, Thing1) Thing2) (result Thing2)

AggregateThing2 iterates over Thing1s, operating on each element while maintaining ‘state’. See: http://clipperhouse.github.io/gen/#Aggregate

func (Thing1s) All

func (rcv Thing1s) All(fn func(Thing1) bool) bool

All verifies that all elements of Thing1s return true for the passed func. See: http://clipperhouse.github.io/gen/#All

func (Thing1s) Any

func (rcv Thing1s) Any(fn func(Thing1) bool) bool

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

func (rcv Thing1s) AverageInt(fn func(Thing1) int) (result int, err error)

AverageInt sums int over all elements and divides by len(Thing1s). See: http://clipperhouse.github.io/gen/#Average

func (Thing1s) AverageThing2

func (rcv Thing1s) AverageThing2(fn func(Thing1) Thing2) (result Thing2, err error)

AverageThing2 sums Thing2 over all elements and divides by len(Thing1s). See: http://clipperhouse.github.io/gen/#Average

func (Thing1s) Count

func (rcv Thing1s) Count(fn func(Thing1) bool) (result int)

Count gives the number elements of Thing1s that return true for the passed func. See: http://clipperhouse.github.io/gen/#Count

func (Thing1s) Distinct

func (rcv Thing1s) Distinct() (result Thing1s)

Distinct returns a new Thing1s slice whose elements are unique. See: http://clipperhouse.github.io/gen/#Distinct

func (Thing1s) DistinctBy

func (rcv Thing1s) DistinctBy(equal func(Thing1, Thing1) bool) (result Thing1s)

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

func (rcv Thing1s) Each(fn func(Thing1))

Each iterates over Thing1s and executes the passed func against each element. See: http://clipperhouse.github.io/gen/#Each

func (Thing1s) First

func (rcv Thing1s) First(fn func(Thing1) bool) (result Thing1, err error)

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

func (rcv Thing1s) GroupByInt(fn func(Thing1) int) map[int]Thing1s

GroupByInt groups elements into a map keyed by int. See: http://clipperhouse.github.io/gen/#GroupBy

func (Thing1s) GroupByString

func (rcv Thing1s) GroupByString(fn func(Thing1) string) map[string]Thing1s

GroupByString groups elements into a map keyed by string. See: http://clipperhouse.github.io/gen/#GroupBy

func (Thing1s) GroupByThing2

func (rcv Thing1s) GroupByThing2(fn func(Thing1) Thing2) map[Thing2]Thing1s

GroupByThing2 groups elements into a map keyed by Thing2. See: http://clipperhouse.github.io/gen/#GroupBy

func (Thing1s) IsSortedBy

func (rcv Thing1s) IsSortedBy(less func(Thing1, Thing1) bool) bool

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

func (rcv Thing1s) IsSortedByDesc(less func(Thing1, Thing1) bool) bool

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

func (rcv Thing1s) MaxBy(less func(Thing1, Thing1) bool) (result Thing1, err error)

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

func (rcv Thing1s) MaxInt(fn func(Thing1) int) (result int, err error)

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

func (rcv Thing1s) MaxString(fn func(Thing1) string) (result string, err error)

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

func (rcv Thing1s) MaxThing2(fn func(Thing1) Thing2) (result Thing2, err error)

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

func (rcv Thing1s) MinBy(less func(Thing1, Thing1) bool) (result Thing1, err error)

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

func (rcv Thing1s) MinInt(fn func(Thing1) int) (result int, err error)

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

func (rcv Thing1s) MinString(fn func(Thing1) string) (result string, err error)

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

func (rcv Thing1s) MinThing2(fn func(Thing1) Thing2) (result Thing2, err error)

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

func (rcv Thing1s) SelectInt(fn func(Thing1) int) (result []int)

SelectInt returns a slice of int in Thing1s, projected by passed func. See: http://clipperhouse.github.io/gen/#Select

func (Thing1s) SelectString

func (rcv Thing1s) SelectString(fn func(Thing1) string) (result []string)

SelectString returns a slice of string in Thing1s, projected by passed func. See: http://clipperhouse.github.io/gen/#Select

func (Thing1s) SelectThing2

func (rcv Thing1s) SelectThing2(fn func(Thing1) Thing2) (result []Thing2)

SelectThing2 returns a slice of Thing2 in Thing1s, projected by passed func. See: http://clipperhouse.github.io/gen/#Select

func (Thing1s) Single

func (rcv Thing1s) Single(fn func(Thing1) bool) (result Thing1, err error)

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

func (rcv Thing1s) SortBy(less func(Thing1, Thing1) bool) Thing1s

SortBy returns a new ordered Thing1s slice, determined by a func defining ‘less’. See: http://clipperhouse.github.io/gen/#SortBy

func (Thing1s) SortByDesc

func (rcv Thing1s) SortByDesc(less func(Thing1, Thing1) bool) Thing1s

SortByDesc returns a new, descending-ordered Thing1s slice, determined by a func defining ‘less’. See: http://clipperhouse.github.io/gen/#SortBy

func (Thing1s) SumInt

func (rcv Thing1s) SumInt(fn func(Thing1) int) (result int)

SumInt sums int over elements in Thing1s. See: http://clipperhouse.github.io/gen/#Sum

func (Thing1s) SumThing2

func (rcv Thing1s) SumThing2(fn func(Thing1) Thing2) (result Thing2)

SumThing2 sums Thing2 over elements in Thing1s. See: http://clipperhouse.github.io/gen/#Sum

func (Thing1s) Where

func (rcv Thing1s) Where(fn func(Thing1) bool) (result Thing1s)

Where returns a new Thing1s slice whose elements return true for func. See: http://clipperhouse.github.io/gen/#Where

type Thing2

type Thing2 Thing3

+gen methods:"Max,Min,Sort"

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

func (rcv Thing2s) IsSorted() bool

IsSorted reports whether Thing2s is sorted. See: http://clipperhouse.github.io/gen/#Sort

func (Thing2s) IsSortedDesc

func (rcv Thing2s) IsSortedDesc() bool

IsSortedDesc reports whether Thing2s is reverse-sorted. See: http://clipperhouse.github.io/gen/#Sort

func (Thing2s) Len

func (rcv Thing2s) Len() int

func (Thing2s) Less

func (rcv Thing2s) Less(i, j int) bool

func (Thing2s) Max

func (rcv Thing2s) Max() (result Thing2, err error)

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

func (rcv Thing2s) Min() (result Thing2, err error)

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

func (rcv Thing2s) Sort() Thing2s

Sort returns a new ordered Thing2s slice. See: http://clipperhouse.github.io/gen/#Sort

func (Thing2s) SortDesc

func (rcv Thing2s) SortDesc() Thing2s

SortDesc returns a new reverse-ordered Thing2s slice. See: http://clipperhouse.github.io/gen/#Sort

func (Thing2s) Swap

func (rcv Thing2s) Swap(i, j int)

type Thing3

type Thing3 float64

Jump to

Keyboard shortcuts

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