linq

package
v0.0.0-...-95ed4ff Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(target interface{}, predicate Predicate) bool

All returns true if the predicate holds for all objects in the collection.

func AllOfDuration

func AllOfDuration(target []time.Duration, predicate PredicateOfDuration) bool

AllOfDuration returns true if the predicate holds for all objects in the collection.

func AllOfFloat

func AllOfFloat(target []float64, predicate PredicateOfFloat) bool

AllOfFloat returns true if the predicate holds for all objects in the collection.

func AllOfInt

func AllOfInt(target []int, predicate PredicateOfInt) bool

AllOfInt returns true if the predicate holds for all objects in the collection.

func AllOfString

func AllOfString(target []string, predicate PredicateOfString) bool

AllOfString returns true if the predicate holds for all objects in the collection.

func AllOfTime

func AllOfTime(target []time.Time, predicate PredicateOfTime) bool

AllOfTime returns true if the predicate holds for all objects in the collection.

func Any

func Any(target interface{}, predicate Predicate) bool

Any returns true if the predicate holds for any object in the collection.

func AnyOfByte

func AnyOfByte(target []byte, predicate PredicateOfByte) bool

AnyOfByte returns true if the predicate holds for any object in the collection.

func AnyOfDuration

func AnyOfDuration(target []time.Duration, predicate PredicateOfDuration) bool

AnyOfDuration returns true if the predicate holds for any object in the collection.

func AnyOfFloat

func AnyOfFloat(target []float64, predicate PredicateOfFloat) bool

AnyOfFloat returns true if the predicate holds for any object in the collection.

func AnyOfInt

func AnyOfInt(target []int, predicate PredicateOfInt) bool

AnyOfInt returns true if the predicate holds for any object in the collection.

func AnyOfRune

func AnyOfRune(target []rune, predicate PredicateOfRune) bool

AnyOfRune returns true if the predicate holds for any object in the collection.

func AnyOfString

func AnyOfString(target []string, predicate PredicateOfString) bool

AnyOfString returns true if the predicate holds for any object in the collection.

func AnyOfTime

func AnyOfTime(target []time.Time, predicate PredicateOfTime) bool

AnyOfTime returns true if the predicate holds for any object in the collection.

func Filter

func Filter(target interface{}, predicate Predicate) []interface{}

Filter applies a predicate to a collection.

func First

func First(target interface{}, predicate Predicate) interface{}

First returns the first object that satisfies a predicate.

func FirstOfByte

func FirstOfByte(target []byte, predicate PredicateOfByte) *byte

FirstOfByte returns the first object that satisfies a predicate.

func FirstOfDuration

func FirstOfDuration(target []time.Duration, predicate PredicateOfDuration) *time.Duration

FirstOfDuration returns the first object that satisfies a predicate.

func FirstOfFloat

func FirstOfFloat(target []float64, predicate PredicateOfFloat) *float64

FirstOfFloat returns the first object that satisfies a predicate.

func FirstOfInt

func FirstOfInt(target []int, predicate PredicateOfInt) *int

FirstOfInt returns the first object that satisfies a predicate.

func FirstOfString

func FirstOfString(target []string, predicate PredicateOfString) *string

FirstOfString returns the first object that satisfies a predicate.

func FirstOfTime

func FirstOfTime(target []time.Time, predicate PredicateOfTime) *time.Time

FirstOfTime returns the first object that satisfies a predicate.

func Last

func Last(target interface{}, predicate Predicate) interface{}

Last returns the last object that satisfies a predicate.

func LastOfDuration

func LastOfDuration(target []time.Duration, predicate PredicateOfDuration) *time.Duration

LastOfDuration returns the last object that satisfies a predicate.

func LastOfFloat

func LastOfFloat(target []float64, predicate PredicateOfFloat) *float64

LastOfFloat returns the last object that satisfies a predicate.

func LastOfInt

func LastOfInt(target []int, predicate PredicateOfInt) *int

LastOfInt returns the last object that satisfies a predicate.

func LastOfString

func LastOfString(target []string, predicate PredicateOfString) *string

LastOfString returns the last object that satisfies a predicate.

func LastOfTime

func LastOfTime(target []time.Time, predicate PredicateOfTime) *time.Time

LastOfTime returns the last object that satisfies a predicate.

func Select

func Select(target interface{}, mapFn MapAction) []interface{}

Select maps the values of the target collection to the mapFn.

func StringToFloat

func StringToFloat(item interface{}) interface{}

StringToFloat is a pre-built map function.

func StringToInt

func StringToInt(item interface{}) interface{}

StringToInt is a pre-built map function.

func ValueToString

func ValueToString(value interface{}) interface{}

ValueToString is a pre-built map function.

Types

type MapAction

type MapAction func(item interface{}) interface{}

MapAction is an action that returns a value for an input value, a.k.a. that maps the two.

type MapActionOfByte

type MapActionOfByte func(item byte) byte

MapActionOfByte is an action that returns a value for an input value, a.k.a. that maps the two.

type MapActionOfDuration

type MapActionOfDuration func(item time.Duration) time.Time

MapActionOfDuration is an action that returns a value for an input value, a.k.a. that maps the two.

type MapActionOfFloat

type MapActionOfFloat func(item float64) float64

MapActionOfFloat is an action that returns a value for an input value, a.k.a. that maps the two.

type MapActionOfInt

type MapActionOfInt func(item int) int

MapActionOfInt is an action that returns a value for an input value, a.k.a. that maps the two.

type MapActionOfInt64

type MapActionOfInt64 func(item int64) int64

MapActionOfInt64 is an action that returns a value for an input value, a.k.a. that maps the two.

type MapActionOfRune

type MapActionOfRune func(item rune) rune

MapActionOfRune is an action that returns a value for an input value, a.k.a. that maps the two.

type MapActionOfString

type MapActionOfString func(item string) string

MapActionOfString is an action that returns a value for an input value, a.k.a. that maps the two.

type MapActionOfTime

type MapActionOfTime func(item time.Time) time.Time

MapActionOfTime is an action that returns a value for an input value, a.k.a. that maps the two.

type Predicate

type Predicate func(item interface{}) bool

Predicate is a function that returns a boolean for an input.

func DeepEqual

func DeepEqual(shouldBe interface{}) Predicate

DeepEqual is a pre-built predicate that compares shouldBe to input objects.

func ReturnsFalse

func ReturnsFalse() Predicate

ReturnsFalse is a pre-built predicate.

func ReturnsTrue

func ReturnsTrue() Predicate

ReturnsTrue is a pre-built predicate.

type PredicateOfByte

type PredicateOfByte func(item byte) bool

PredicateOfByte is a function that returns a boolean for an input.

func EqualsOfByte

func EqualsOfByte(shouldBe byte) PredicateOfByte

EqualsOfByte is a pre-built predicate that compares shouldBe to input objects.

func ReturnsFalseOfByte

func ReturnsFalseOfByte() PredicateOfByte

ReturnsFalseOfByte is a pre-built predicate.

func ReturnsTrueOfByte

func ReturnsTrueOfByte() PredicateOfByte

ReturnsTrueOfByte is a pre-built predicate.

type PredicateOfDuration

type PredicateOfDuration func(item time.Duration) bool

PredicateOfDuration is a function that returns a boolean for an input.

func ReturnsFalseOfDuration

func ReturnsFalseOfDuration() PredicateOfDuration

ReturnsFalseOfDuration is a pre-built predicate.

func ReturnsTrueOfDuration

func ReturnsTrueOfDuration() PredicateOfDuration

ReturnsTrueOfDuration is a pre-built predicate.

type PredicateOfFloat

type PredicateOfFloat func(item float64) bool

PredicateOfFloat is a function that returns a boolean for an input.

func EqualsOfFloat

func EqualsOfFloat(shouldBe float64) PredicateOfFloat

EqualsOfFloat is a pre-built predicate that compares shouldBe to input objects.

func ReturnsFalseOfFloat

func ReturnsFalseOfFloat() PredicateOfFloat

ReturnsFalseOfFloat is a pre-built predicate.

func ReturnsTrueOfFloat

func ReturnsTrueOfFloat() PredicateOfFloat

ReturnsTrueOfFloat is a pre-built predicate.

type PredicateOfInt

type PredicateOfInt func(item int) bool

PredicateOfInt is a function that returns a boolean for an input.

func EqualsOfInt

func EqualsOfInt(shouldBe int) PredicateOfInt

EqualsOfInt is a pre-built predicate that compares shouldBe to input objects.

func ReturnsFalseOfInt

func ReturnsFalseOfInt() PredicateOfInt

ReturnsFalseOfInt is a pre-built predicate.

func ReturnsTrueOfInt

func ReturnsTrueOfInt() PredicateOfInt

ReturnsTrueOfInt is a pre-built predicate.

type PredicateOfInt64

type PredicateOfInt64 func(item int64) bool

PredicateOfInt64 is a function that returns a boolean for an input.

type PredicateOfRune

type PredicateOfRune func(item rune) bool

PredicateOfRune is a function that returns a boolean for an input.

func EqualsOfRune

func EqualsOfRune(shouldBe rune) PredicateOfRune

EqualsOfRune is a pre-built predicate that compares shouldBe to input objects.

func ReturnsFalseOfRune

func ReturnsFalseOfRune() PredicateOfRune

ReturnsFalseOfRune is a pre-built predicate.

func ReturnsTrueOfRune

func ReturnsTrueOfRune() PredicateOfRune

ReturnsTrueOfRune is a pre-built predicate.

type PredicateOfString

type PredicateOfString func(item string) bool

PredicateOfString is a function that returns a boolean for an input.

func EqualsOfString

func EqualsOfString(shouldBe string) PredicateOfString

EqualsOfString is a pre-built predicate that compares shouldBe to input objects.

func EqualsOfStringCaseInsenitive

func EqualsOfStringCaseInsenitive(shouldBe string) PredicateOfString

EqualsOfStringCaseInsenitive is a pre-built predicate that compares shouldBe to input objects.

func ReturnsFalseOfString

func ReturnsFalseOfString() PredicateOfString

ReturnsFalseOfString is a pre-built predicate.

func ReturnsTrueOfString

func ReturnsTrueOfString() PredicateOfString

ReturnsTrueOfString is a pre-built predicate.

type PredicateOfTime

type PredicateOfTime func(item time.Time) bool

PredicateOfTime is a function that returns a boolean for an input.

func ReturnsFalseOfTime

func ReturnsFalseOfTime() PredicateOfTime

ReturnsFalseOfTime is a pre-built predicate.

func ReturnsTrueOfTime

func ReturnsTrueOfTime() PredicateOfTime

ReturnsTrueOfTime is a pre-built predicate.

Jump to

Keyboard shortcuts

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