Documentation ¶
Index ¶
- func ContainsString(s string, a []string) bool
- func ContentTypeFromFileName(filename string) (string, error)
- func DayStr(t time.Time) string
- func DotX(a []float64, b float64) []float64
- func DotXX(a [][]float64, b float64) [][]float64
- func ExistsOnDisk(path string) (bool, error)
- func FancyRandStr(length int) string
- func FastFail(failure string, args ...int)
- func FiveCharPrefix(s string) string
- func FliterFloat64Array(a []float64, filter func(f float64) bool) []float64
- func Folderify(filename string) string
- func Mapify(thing interface{}) (map[string]interface{}, error)
- func MaxInt(a, b int) int
- func MaxInt64(a, b int64) int64
- func MeanFloat64(a []float64) float64
- func MeanInt64(a []int64) float64
- func MedianFloat64(input []float64) (median float64)
- func MedianInt64(input []int64) (median float64)
- func MinInt(a, b int) int
- func MinInt64(a, b int64) int64
- func NextID() string
- func NextId() string
- func RandStr100(length int) string
- func RandomString(length int, includeUpperCase bool, includeDigits bool) string
- func Reverse(input string) string
- func SleepItOff(d time.Duration)
- func Spinner() string
- func StoragePathFromURL(url *url.URL) (string, error)
- func StringArrayContains(a []string, s string) bool
- func StringArraysHaveSameElements(a, b []string) bool
- func UniqueArray[K comparable](a []K) []K
- func UniqueIDForBlob(blob []byte) string
- func Unzipb64(s string) (string, error)
- func Zipb64(s string) string
- type SortableFloat64Array
- type SortableInt64Array
- type SortableStringArray
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsString ¶
func ContentTypeFromFileName ¶
func ExistsOnDisk ¶
func FancyRandStr ¶
func FastFail ¶ added in v0.2.2
FastFail is a GomegaFailHandler that, when run with `go test -failfast` , fails immidiately and halts other long running tests prints the line number of the test that failed from conversation with @onsi https://github.com/onsi/gomega/issues/660 this makes it possible to fail fast and not wait for all the tests to finish if they are going to fail usage: in your test, as the first line of the test, add this:
RegisterFailHandler(aliU.FastFail)
func FiveCharPrefix ¶
func FliterFloat64Array ¶
func Mapify ¶
Mapify converts any struct to a json friendly map of string to interface it expects the thing to have autogenerated json tags float64 are supported while ints are not Damn and embedded strucs are not flattened by default :p
func MeanFloat64 ¶
func MedianFloat64 ¶
func MedianInt64 ¶ added in v0.2.1
it returns the median of a slice of int64 it returns float64 because sometimes the median is not an int
func NextID ¶
func NextID() string
NextID is used to generate sessionid s uses the time reverses it, to avoid problems like "hot hashes" and busy shards an overkill but a good practice
func NextId ¶
func NextId() string
used to generate sessionid s uses the time reverses it, to avoid problems like "hot hashes" and busy shards and over kill but a good practice
func RandStr100 ¶
func SleepItOff ¶
func StringArrayContains ¶
func UniqueArray ¶
func UniqueArray[K comparable](a []K) []K
func UniqueIDForBlob ¶
Types ¶
type SortableFloat64Array ¶
type SortableFloat64Array []float64
func (SortableFloat64Array) Len ¶
func (a SortableFloat64Array) Len() int
func (SortableFloat64Array) Less ¶
func (a SortableFloat64Array) Less(i, j int) bool
func (SortableFloat64Array) Swap ¶
func (a SortableFloat64Array) Swap(i, j int)
type SortableInt64Array ¶ added in v0.2.1
type SortableInt64Array []int64
func (SortableInt64Array) Len ¶ added in v0.2.1
func (a SortableInt64Array) Len() int
func (SortableInt64Array) Less ¶ added in v0.2.1
func (a SortableInt64Array) Less(i, j int) bool
func (SortableInt64Array) Swap ¶ added in v0.2.1
func (a SortableInt64Array) Swap(i, j int)
type SortableStringArray ¶
type SortableStringArray []string
func (SortableStringArray) Len ¶
func (a SortableStringArray) Len() int
func (SortableStringArray) Less ¶
func (a SortableStringArray) Less(i, j int) bool
func (SortableStringArray) Swap ¶
func (a SortableStringArray) Swap(i, j int)