Documentation ¶
Index ¶
- func FormatDateTime(sec int64, layout string) string
- func FormatTimestamp(date, layout string) int64
- func GetRandomNum(min, max int) int
- func GetRandomUuid() string
- func InSlice(v string, sl []string) bool
- func InSliceIface(v interface{}, sl []interface{}) bool
- func InSliceInt(v int, l []int) bool
- func InSliceInt64(v int64, l []int64) bool
- func Md5(raw string) string
- func NowTimestamp() int64
- func Round(f float64, n int) float64
- func SliceChunk(slice []interface{}, size int) (chunkslice [][]interface{})
- func SliceDiff(slice1, slice2 []interface{}) (diffslice []interface{})
- func SliceFilter(slice []interface{}, a filtertype) (ftslice []interface{})
- func SliceIntersect(slice1, slice2 []interface{}) (diffslice []interface{})
- func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
- func SliceMergeInt(s1, s2 []int) (s []int)
- func SlicePad(slice []interface{}, size int, val interface{}) []interface{}
- func SliceRand(a []interface{}) (b interface{})
- func SliceRandList(min, max int) []int
- func SliceRange(start, end, step int64) (intslice []int64)
- func SliceReduce(slice []interface{}, a reducetype) (dslice []interface{})
- func SliceShuffle(slice []interface{}) []interface{}
- func SliceSum(intslice []int64) (sum int64)
- func SliceUnique(slice []interface{}) (uniqueslice []interface{})
- func StringSliceUnique(slice []string) (unique []string)
- func SubUnixTimeDays(start, end int64, layout string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InSliceIface ¶
func InSliceIface(v interface{}, sl []interface{}) bool
InSliceIface checks given interface in interface slice.
func InSliceInt ¶
func InSliceInt64 ¶
func SliceChunk ¶
func SliceChunk(slice []interface{}, size int) (chunkslice [][]interface{})
SliceChunk separates one slice to some sized slice.
func SliceDiff ¶
func SliceDiff(slice1, slice2 []interface{}) (diffslice []interface{})
SliceDiff returns diff slice of slice1 - slice2.
func SliceFilter ¶
func SliceFilter(slice []interface{}, a filtertype) (ftslice []interface{})
SliceFilter generates a new slice after filter function.
func SliceIntersect ¶
func SliceIntersect(slice1, slice2 []interface{}) (diffslice []interface{})
SliceIntersect returns slice that are present in all the slice1 and slice2.
func SliceMerge ¶
func SliceMerge(slice1, slice2 []interface{}) (c []interface{})
SliceMerge merges interface slices to one slice.
func SliceMergeInt ¶
func SlicePad ¶
func SlicePad(slice []interface{}, size int, val interface{}) []interface{}
SlicePad prepends size number of val into slice.
func SliceRand ¶
func SliceRand(a []interface{}) (b interface{})
SliceRand returns random one from slice.
func SliceRandList ¶
SliceRandList generate an int slice from min to max.
func SliceRange ¶
SliceRange generates a new slice from begin to end with step duration of int64 number.
func SliceReduce ¶
func SliceReduce(slice []interface{}, a reducetype) (dslice []interface{})
SliceReduce generates a new slice after parsing every value by reduce function
func SliceShuffle ¶
func SliceShuffle(slice []interface{}) []interface{}
SliceShuffle shuffles a slice.
func SliceUnique ¶
func SliceUnique(slice []interface{}) (uniqueslice []interface{})
SliceUnique cleans repeated values in slice.
func StringSliceUnique ¶
Types ¶
This section is empty.