Documentation ¶
Index ¶
- func All(objs ...interface{}) bool
- func Any(objs ...interface{}) bool
- func Chunk(arr interface{}, size int) interface{}
- func Contains(in interface{}, elem interface{}) bool
- func ContainsFloat32(s []float32, v float32) bool
- func ContainsFloat64(s []float64, v float64) bool
- func ContainsInt(s []int, v int) bool
- func ContainsInt32(s []int32, v int32) bool
- func ContainsInt64(s []int64, v int64) bool
- func ContainsString(s []string, v string) bool
- func ConvertSlice(in interface{}, out interface{})
- func Equal(expected interface{}, actual interface{}) bool
- func Every(in interface{}, elements ...interface{}) bool
- func Fill(in interface{}, fillValue interface{}) (interface{}, error)
- func Filter(arr interface{}, predicate interface{}) interface{}
- func FilterFloat32(s []float32, cb func(s float32) bool) []float32
- func FilterFloat64(s []float64, cb func(s float64) bool) []float64
- func FilterInt(s []int, cb func(s int) bool) []int
- func FilterInt32(s []int32, cb func(s int32) bool) []int32
- func FilterInt64(s []int64, cb func(s int64) bool) []int64
- func FilterString(s []string, cb func(s string) bool) []string
- func Find(arr interface{}, predicate interface{}) interface{}
- func FindFloat32(s []float32, cb func(s float32) bool) (float32, bool)
- func FindFloat64(s []float64, cb func(s float64) bool) (float64, bool)
- func FindInt(s []int, cb func(s int) bool) (int, bool)
- func FindInt32(s []int32, cb func(s int32) bool) (int32, bool)
- func FindInt64(s []int64, cb func(s int64) bool) (int64, bool)
- func FindString(s []string, cb func(s string) bool) (string, bool)
- func FlattenDeep(out interface{}) interface{}
- func ForEach(arr interface{}, predicate interface{})
- func ForEachRight(arr interface{}, predicate interface{})
- func Get(out interface{}, path string) interface{}
- func Head(arr interface{}) interface{}
- func InFloat32s(s []float32, v float32) bool
- func InFloat64s(s []float64, v float64) bool
- func InInt32s(s []int32, v int32) bool
- func InInt64s(s []int64, v int64) bool
- func InInts(s []int, v int) bool
- func InStrings(s []string, v string) bool
- func IndexOf(in interface{}, elem interface{}) int
- func IndexOfFloat64(a []float64, x float64) int
- func IndexOfInt(a []int, x int) int
- func IndexOfInt32(a []int32, x int32) int
- func IndexOfInt64(a []int64, x int64) int
- func IndexOfString(a []string, x string) int
- func Initial(arr interface{}) interface{}
- func IsEmpty(obj interface{}) bool
- func IsEqual(expected interface{}, actual interface{}) bool
- func IsFunction(in interface{}, num ...int) bool
- func IsIteratee(in interface{}) bool
- func IsType(expected interface{}, actual interface{}) bool
- func IsZero(obj interface{}) bool
- func Keys(out interface{}) interface{}
- func Last(arr interface{}) interface{}
- func LastIndexOf(in interface{}, elem interface{}) int
- func LastIndexOfFloat32(a []float32, x float32) int
- func LastIndexOfFloat64(a []float64, x float64) int
- func LastIndexOfInt(a []int, x int) int
- func LastIndexOfInt32(a []int32, x int32) int
- func LastIndexOfInt64(a []int64, x int64) int
- func LastIndexOfString(a []string, x string) int
- func Map(arr interface{}, mapFunc interface{}) interface{}
- func NotEmpty(obj interface{}) bool
- func NotEqual(expected interface{}, actual interface{}) bool
- func Product(arr interface{}) float64
- func PtrOf(itf interface{}) interface{}
- func RandomInt(min, max int) int
- func RandomString(n int, allowedChars ...[]rune) string
- func Reduce(arr, reduceFunc, acc interface{}) float64
- func Reverse(in interface{}) interface{}
- func ReverseFloat32(s []float32) []float32
- func ReverseFloat64(s []float64) []float64
- func ReverseInt(s []int) []int
- func ReverseInt32(s []int32) []int32
- func ReverseInt64(s []int64) []int64
- func ReverseString(s string) string
- func ReverseStrings(s []string) []string
- func Shard(str string, width int, depth int, restOnly bool) []string
- func Shuffle(in interface{}) interface{}
- func ShuffleFloat32(a []float32) []float32
- func ShuffleFloat64(a []float64) []float64
- func ShuffleInt(a []int) []int
- func ShuffleInt32(a []int32) []int32
- func ShuffleInt64(a []int64) []int64
- func ShuffleString(a []string) []string
- func SliceOf(in interface{}) interface{}
- func Sum(arr interface{}) float64
- func SumBy(arr interface{}, key string) float64
- func SumFloat32(s []float32) (sum float32)
- func SumFloat64(s []float64) (sum float64)
- func SumInt(s []int) (sum int)
- func SumInt32(s []int32) (sum int32)
- func SumInt64(s []int64) (sum int64)
- func Tail(arr interface{}) interface{}
- func ToFloat64(x interface{}) (float64, bool)
- func ToMap(in interface{}, pivot string) interface{}
- func Uniq(in interface{}) interface{}
- func UniqFloat32(a []float32) []float32
- func UniqFloat64(a []float64) []float64
- func UniqInt(a []int) []int
- func UniqInt32(a []int32) []int32
- func UniqInt64(a []int64) []int64
- func UniqString(a []string) []string
- func Values(out interface{}) interface{}
- func ZeroOf(in interface{}) interface{}
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
func All(objs ...interface{}) bool
All returns true if all elements of the iterable are not empty (or if the iterable is empty)
func Any ¶
func Any(objs ...interface{}) bool
Any returns true if any element of the iterable is not empty. If the iterable is empty, return False.
func Chunk ¶
func Chunk(arr interface{}, size int) interface{}
Chunk creates an array of elements split into groups with the length of size. If array can't be split evenly, the final chunk will be the remaining element.
func Contains ¶
func Contains(in interface{}, elem interface{}) bool
Contains returns true if an element is present in a iteratee.
func ContainsFloat32 ¶
ContainsFloat32 returns true if a float32 is present in a iteratee.
func ContainsFloat64 ¶
ContainsFloat64 returns true if a float64 is present in a iteratee.
func ContainsInt ¶
ContainsInt returns true if an int is present in a iteratee.
func ContainsInt32 ¶
ContainsInt32 returns true if an int32 is present in a iteratee.
func ContainsInt64 ¶
ContainsInt64 returns true if an int64 is present in a iteratee.
func ContainsString ¶
ContainsString returns true if a string is present in a iteratee.
func ConvertSlice ¶
func ConvertSlice(in interface{}, out interface{})
ConvertSlice converts a slice type to another, a perfect example would be to convert a slice of struct to a slice of interface.
func Equal ¶
func Equal(expected interface{}, actual interface{}) bool
Equal returns if the two objects are equal
func Every ¶
func Every(in interface{}, elements ...interface{}) bool
Every returns true if every element is present in a iteratee.
func Fill ¶
func Fill(in interface{}, fillValue interface{}) (interface{}, error)
Fill fills elements of array with value
func Filter ¶
func Filter(arr interface{}, predicate interface{}) interface{}
Filter iterates over elements of collection, returning an array of all elements predicate returns truthy for.
func FilterFloat32 ¶
FilterFloat32 iterates over a collection of float32, returning an array of all float32 elements predicate returns truthy for.
func FilterFloat64 ¶
FilterFloat64 iterates over a collection of float64, returning an array of all float64 elements predicate returns truthy for.
func FilterInt ¶
FilterInt iterates over a collection of int, returning an array of all int elements predicate returns truthy for.
func FilterInt32 ¶
FilterInt32 iterates over a collection of int32, returning an array of all int32 elements predicate returns truthy for.
func FilterInt64 ¶
FilterInt64 iterates over a collection of int64, returning an array of all int64 elements predicate returns truthy for.
func FilterString ¶
FilterString iterates over a collection of string, returning an array of all string elements predicate returns truthy for.
func Find ¶
func Find(arr interface{}, predicate interface{}) interface{}
Find iterates over elements of collection, returning the first element predicate returns truthy for.
func FindFloat32 ¶
FindFloat32 iterates over a collection of float32, returning the first float32 element predicate returns truthy for.
func FindFloat64 ¶
FindFloat64 iterates over a collection of float64, returning an array of all float64 elements predicate returns truthy for.
func FindInt ¶
FindInt iterates over a collection of int, returning the first int element predicate returns truthy for.
func FindInt32 ¶
FindInt32 iterates over a collection of int32, returning the first int32 element predicate returns truthy for.
func FindInt64 ¶
FindInt64 iterates over a collection of int64, returning the first int64 element predicate returns truthy for.
func FindString ¶
FindString iterates over a collection of string, returning the first string element predicate returns truthy for.
func FlattenDeep ¶
func FlattenDeep(out interface{}) interface{}
FlattenDeep recursively flattens array.
func ForEach ¶
func ForEach(arr interface{}, predicate interface{})
ForEach iterates over elements of collection and invokes iteratee for each element.
func ForEachRight ¶
func ForEachRight(arr interface{}, predicate interface{})
ForEachRight iterates over elements of collection from the right and invokes iteratee for each element.
func Get ¶
func Get(out interface{}, path string) interface{}
Get retrieves the value at path of struct(s).
func InFloat32s ¶
InFloat32s is an alias of ContainsFloat32, returns true if a float32 is present in a iteratee.
func InFloat64s ¶
InFloat64s is an alias of ContainsFloat64, returns true if a float64 is present in a iteratee.
func InInt32s ¶
InInt32s is an alias of ContainsInt32, returns true if an int32 is present in a iteratee.
func InInt64s ¶
InInt64s is an alias of ContainsInt64, returns true if an int64 is present in a iteratee.
func InStrings ¶
InStrings is an alias of ContainsString, returns true if a string is present in a iteratee.
func IndexOf ¶
func IndexOf(in interface{}, elem interface{}) int
IndexOf gets the index at which the first occurrence of value is found in array or return -1 if the value cannot be found
func IndexOfFloat64 ¶
IndexOfFloat64 gets the index at which the first occurrence of an float64 value is found in array or return -1 if the value cannot be found
func IndexOfInt ¶
IndexOfInt gets the index at which the first occurrence of an int value is found in array or return -1 if the value cannot be found
func IndexOfInt32 ¶
IndexOfInt32 gets the index at which the first occurrence of an int32 value is found in array or return -1 if the value cannot be found
func IndexOfInt64 ¶
IndexOfInt64 gets the index at which the first occurrence of an int64 value is found in array or return -1 if the value cannot be found
func IndexOfString ¶
IndexOfString gets the index at which the first occurrence of a string value is found in array or return -1 if the value cannot be found
func Initial ¶
func Initial(arr interface{}) interface{}
Initial gets all but the last element of array.
func IsEmpty ¶
func IsEmpty(obj interface{}) bool
IsEmpty returns if the object is considered as empty or not.
func IsEqual ¶
func IsEqual(expected interface{}, actual interface{}) bool
IsEqual returns if the two objects are equal
func IsFunction ¶
IsFunction returns if the argument is a function.
func IsIteratee ¶
func IsIteratee(in interface{}) bool
IsIteratee returns if the argument is an iteratee.
func IsType ¶
func IsType(expected interface{}, actual interface{}) bool
IsType returns if the two objects are in the same type
func IsZero ¶
func IsZero(obj interface{}) bool
IsZero returns if the object is considered as zero value
func Keys ¶
func Keys(out interface{}) interface{}
Keys creates an array of the own enumerable map keys or struct field names.
func LastIndexOf ¶
func LastIndexOf(in interface{}, elem interface{}) int
LastIndexOf gets the index at which the last occurrence of value is found in array or return -1 if the value cannot be found
func LastIndexOfFloat32 ¶
LastIndexOfFloat32 gets the index at which the first occurrence of an float32 value is found in array or return -1 if the value cannot be found
func LastIndexOfFloat64 ¶
LastIndexOfFloat64 gets the index at which the first occurrence of an float64 value is found in array or return -1 if the value cannot be found
func LastIndexOfInt ¶
LastIndexOfInt gets the index at which the first occurrence of an int value is found in array or return -1 if the value cannot be found
func LastIndexOfInt32 ¶
LastIndexOfInt32 gets the index at which the first occurrence of an int32 value is found in array or return -1 if the value cannot be found
func LastIndexOfInt64 ¶
LastIndexOfInt64 gets the index at which the first occurrence of an int64 value is found in array or return -1 if the value cannot be found
func LastIndexOfString ¶
LastIndexOfString gets the index at which the first occurrence of a string value is found in array or return -1 if the value cannot be found
func Map ¶
func Map(arr interface{}, mapFunc interface{}) interface{}
Map manipulates an iteratee and transforms it to another type.
func NotEmpty ¶
func NotEmpty(obj interface{}) bool
NotEmpty returns if the object is considered as non-empty or not.
func NotEqual ¶
func NotEqual(expected interface{}, actual interface{}) bool
NotEqual returns if the two objects are not equal
func Product ¶
func Product(arr interface{}) float64
Product computes the product of the values in array.
func PtrOf ¶
func PtrOf(itf interface{}) interface{}
PtrOf makes a copy of the given interface and returns a pointer.
func RandomString ¶
RandomString returns a random string with a fixed length
func Reverse ¶
func Reverse(in interface{}) interface{}
Reverse transforms an array the first element will become the last, the second element will become the second to last, etc.
func ReverseFloat32 ¶
ReverseFloat32 reverses an array of float32
func ReverseFloat64 ¶
ReverseFloat64 reverses an array of float64
func ReverseStrings ¶
ReverseStrings reverses an array of string
func ShuffleFloat32 ¶
ShuffleFloat32 creates an array of float32 shuffled values using Fisher–Yates algorithm
func ShuffleFloat64 ¶
ShuffleFloat64 creates an array of float64 shuffled values using Fisher–Yates algorithm
func ShuffleInt ¶
ShuffleInt creates an array of int shuffled values using Fisher–Yates algorithm
func ShuffleInt32 ¶
ShuffleInt32 creates an array of int32 shuffled values using Fisher–Yates algorithm
func ShuffleInt64 ¶
ShuffleInt64 creates an array of int64 shuffled values using Fisher–Yates algorithm
func ShuffleString ¶
ShuffleString creates an array of string shuffled values using Fisher–Yates algorithm
func SliceOf ¶
func SliceOf(in interface{}) interface{}
SliceOf returns a slice which contains the element.
func SumFloat32 ¶
SumFloat32 sums a float32 iteratee and returns the sum of all elements
func SumFloat64 ¶
SumFloat64 sums a float64 iteratee and returns the sum of all elements
func ToMap ¶
func ToMap(in interface{}, pivot string) interface{}
ToMap transforms a slice of instances to a Map. []*Foo => Map<int, *Foo>
func UniqFloat32 ¶
UniqFloat32 creates an array of float32 with unique values.
func UniqFloat64 ¶
UniqFloat64 creates an array of float64 with unique values.
func UniqString ¶
UniqString creates an array of string with unique values.