Documentation ¶
Index ¶
- Constants
- Variables
- func AccessAllowed(accessList []string, item string) bool
- func AddMatrices[T float64 | int64](matrix1 [][]T, matrix2 [][]T, result [][]T) error
- func AddMultipleMatrices[T float64 | int64](matrices [][][]T, result [][]T) error
- func AddScalarMatrix[T float64 | int64](matrix [][]T, scalar T, result [][]T) error
- func All[T ValueType](arr []T, testFunc TestFuncType[T]) bool
- func Any[T ValueType](arr []T, testFunc TestFuncType[T]) bool
- func ArrayContains[T ValueType](arr []T, str T) bool
- func ArrayContainsCaseSensitive[T ValueType](arr []T, str T) bool
- func ArrayFloatContains(arr []float64, str float64) bool
- func ArrayIntContains(arr []int, val int) bool
- func ArrayMapToMapUnderscore(rec interface{}) ([]map[string]interface{}, error)
- func ArrayMapToStruct(actParams []map[string]interface{}, recs interface{}) (interface{}, error)
- func ArrayStringContains(arr []string, val string) bool
- func ArrayStringContainsCaseSensitive(arr []string, val string) bool
- func ArrayToSQLStringValues(arr []string) string
- func CaseFieldToUnderscore(caseString string) string
- func Classify()
- func ComparePassword(userPassword string, inputPassword string, cryptCode string) (bool, error)
- func ComparePassword2(userPassword string, inputPassword string, cryptCode string) (bool, error)
- func ComputeTaskDuration(start time.Time, end time.Time) int64
- func ConvertByteSliceToBase64Str(fileContent []byte) string
- func ConvertJsonBase64StringToMap(base64Str interface{}) (map[string]interface{}, error)
- func ConvertJsonBase64StringToTypeValue(base64Str interface{}, typePointer interface{}) (interface{}, error)
- func ConvertJsonStringToMapValue(jsonStr string) (map[string]interface{}, error)
- func ConvertJsonStringToTypeValue(jsonStr string, typePointer interface{}) error
- func ConvertStringToBase64Str(fileContent string) string
- func CurrencyNumFormatter(num *big.Float, currency string, precision int) (string, error)
- func DivideScalarMatrix[T float64 | int64](matrix [][]T, scalar T, result [][]T) error
- func EncryptPassword(newPassword string, cryptCode string) (string, error)
- func ExcludeEmptyIdFields(recs []map[string]interface{}) []map[string]interface{}
- func ExcludeEmptyIdFromMapRecord(rec map[string]interface{}) map[string]interface{}
- func ExcludeFieldFromMapRecord(rec map[string]interface{}, field string) map[string]interface{}
- func ExitOnError(err error)
- func FactNumGen(num uint, factChannel chan<- int)
- func Factorial(num uint) int
- func FactorialGen2(num uint) int
- func FactorialTail(num uint, acc uint) uint
- func FiboArray(num uint, result [][]uint)
- func FiboSeries(num uint, fiboChannel chan<- uint)
- func FiboTail(num int, current int, next int) int
- func Fibos(num uint) []uint
- func Filter[T ValueType](arr []T, filterFunc func(T) bool, result []T)
- func FilterGen[T ValueType](arr []T, filterFunc func(T) bool, filterChan chan<- T)
- func GeometricMean[T Number](arr []T) float64
- func GetHashValue(info interface{}, cryptCode string) (string, error)
- func GetLanguage(userLang string) string
- func GetParamsMessage(msgObject MessageObject) mcresponse.ResponseMessage
- func Index[T ValueType](arr []T, val T) int
- func IndexCaseSensitive[T ValueType](arr []T, val T) int
- func Interval[T Number](arr []T) float64
- func IsLeapYear(year int) bool
- func IsPrime(n int) bool
- func JsonToStruct(jsonRec []byte, rec interface{}) error
- func Knn()
- func Map[T ValueType](arr []T, mapFunc func(T) T, result []T)
- func MapFloat(arr []float64, mapFunc func(float64) float64, result []float64)
- func MapGen[T ValueType](arr []T, mapFunc func(T) T, mapChan chan<- T)
- func MapInt(arr []int, mapFunc func(int) int, result []int)
- func MapString(arr []string, mapFunc func(string) string, result []string)
- func MapToMapUnderscore(rec interface{}) (map[string]interface{}, error)
- func MapToStruct(mapRecord map[string]interface{}, rec interface{}) (interface{}, error)
- func MapUnderscoreToMapCamelCase(rec interface{}, sep string) (map[string]interface{}, error)
- func Max[T Number](arr []T) T
- func Mean[T Number](arr []T) float64
- func MeanSquareError()
- func MeanSquareRootError()
- func Median[T Number](arr []T) float64
- func Min[T Number](arr []T) T
- func MinMax[T Number](arr []T) (min T, max T)
- func MultiplyMatrices[T float64 | int64](matrix1 [][]T, matrix2 [][]T, result [][]T) error
- func MultiplyMatrix[T float64 | int64](matrix1 []T, matrix2 [][]T, result []T) error
- func MultiplyScalarMatrix[T float64 | int64](matrix [][]T, scalar T, result [][]T) error
- func NBayes()
- func NaturalNumbers(num uint, cntChannel chan<- uint)
- func NaturalNumbersGen(num uint, naturalChan chan<- uint)
- func NaturalNumbersGenInf(naturalChan chan<- uint, stopFunc func() bool)
- func NumFormatter(num *big.Float, precision int) (string, error)
- func PanicOnError(err error)
- func ParseRawValues(rawValues [][]byte) ([]interface{}, error)
- func PopulationStandardDeviation[T Number](arr []T) float64
- func PrimeNumbers(num int) (pNums []int)
- func Pythagoras(limit uint) [][]uint
- func PythagorasGen(limit uint, pythagorasChan chan []uint)
- func RandomNumbers(n int) string
- func RandomString(n int) string
- func Range[T Number](arr []T) T
- func ReverseArray[T ValueType](arr []T, result []T)
- func ReverseArrayFloat(arr []float64, result []float64)
- func ReverseArrayFloatGen(arr []float64, arrChan chan<- float64)
- func ReverseArrayGenerator[T ValueType](arr []T, arrChan chan<- T)
- func ReverseArrayInt(arr []int, result []int)
- func ReverseArrayIntGen(arr []int, arrChan chan<- int)
- func SampleStandardDeviation[T Number](arr []T) float64
- func SeparatorFieldToCamelCase(text string, sep string) (string, error)
- func SeparatorFieldToPascalCase(text string, sep string) (string, error)
- func ShortString(str string, maxLength uint) string
- func StringToBool(val string) bool
- func StructToFieldValues(rec interface{}) (tableFields []string, fieldValues []interface{}, err error)
- func StructToMap(rec interface{}) (map[string]interface{}, error)
- func StructToMapTag(rec interface{}, tag string) (map[string]interface{}, error)
- func StructToMapUnderscore(rec interface{}) (map[string]interface{}, error)
- func StructToMapUnderscoreData(rec interface{}) (map[string]interface{}, error)
- func SubtractMatrices[T float64 | int64](matrix1 [][]T, matrix2 [][]T, result [][]T) error
- func SubtractMultipleMatrices[T float64 | int64](matrices [][][]T, result [][]T) error
- func SubtractScalarMatrix[T float64 | int64](matrix [][]T, scalar T, result [][]T) error
- func TagField(rec interface{}, fieldName string, tag string) (string, error)
- func Take[T ValueType](num uint, arr []T, result []T)
- func TakeGen[T ValueType](num uint, arr []T, takeChan chan<- T)
- func TransposeMatrix[T float64 | int64](matrix [][]T, result [][]T) error
- func TypeOf(rec interface{}) reflect.Type
- func Variance[T Number](arr []T) float64
- type ArrayOfFloat
- type ArrayOfInt
- type ArrayOfString
- type ArrayValue
- type BiConsumer
- type BiFunction
- type BinaryOperator
- type BinaryPredicate
- type BoolSliceType
- type BoolType
- type Comparator
- type Consumer
- type CounterObjectValue
- type CounterResult
- type CounterValue
- type DataCount
- type FloatPredicate
- type FloatSliceType
- type FloatType
- type FrequencyResult
- type FrequencyValue
- type Function
- type GenericSliceType
- func (arr *GenericSliceType[T]) All(testFunc TestFuncType[T]) bool
- func (arr *GenericSliceType[T]) Any(testFunc TestFuncType[T]) bool
- func (arr *GenericSliceType[T]) ArrayContains(queryVal T) bool
- func (arr *GenericSliceType[T]) ArrayContainsCaseSensitive(str T) bool
- func (arr *GenericSliceType[T]) Filter(filterFunc func(T) bool, result []T)
- func (arr *GenericSliceType[T]) FilterGen(filterFunc func(T) bool, filterChan chan<- T)
- func (arr *GenericSliceType[T]) Index(queryVal T) int
- func (arr *GenericSliceType[T]) IndexCaseSensitive(val T) int
- func (arr *GenericSliceType[T]) Map(mapFunc func(T) T, result []T)
- func (arr *GenericSliceType[T]) MapGen(mapFunc func(T) T, mapChan chan<- T)
- func (arr *GenericSliceType[T]) ReverseArray(result []T)
- func (arr *GenericSliceType[T]) ReverseArrayGenerator(arrChan chan<- T)
- func (arr *GenericSliceType[T]) Take(num uint, result []T)
- func (arr *GenericSliceType[T]) TakeGen(num uint, takeChan chan<- T)
- type GenericType
- type IntPredicate
- type IntSliceType
- type IntType
- type Locale
- type LocaleContent
- type LocaleFilesType
- type LocaleFunc
- type LocaleOptions
- type LocaleValueType
- type MessageObject
- type Number
- type NumberPredicate
- type ObjectCounterResult
- type ObjectType
- type Predicate
- type QuartilesType
- type SliceObjectType
- type StatFrequencyResult
- type StatFrequencyValue
- type StringPredicate
- type StringSliceType
- type StringType
- type Supplier
- type TestFuncType
- type UnaryOperator
- type ValueType
- type ValueTypeSlice
Constants ¶
const (
DefaultLanguage = "en-US"
)
Variables ¶
var PermittedSeparators = []string{" ", "_", "__", ".", "|"}
Functions ¶
func AccessAllowed ¶ added in v0.2.0
func AddMatrices ¶ added in v0.2.0
AddMatrices function adds two matrices of the same dimensions.
func AddMultipleMatrices ¶ added in v0.2.0
AddMultipleMatrices function [tensor] adds multiple matrices of the same dimensions.
func AddScalarMatrix ¶ added in v0.2.0
AddScalarMatrix function adds a scalar Value to the matrix/matrices.
func All ¶ added in v0.1.7
func All[T ValueType](arr []T, testFunc TestFuncType[T]) bool
All function determines if all the slice-values satisfies the testFunc.
func Any ¶ added in v0.1.7
func Any[T ValueType](arr []T, testFunc TestFuncType[T]) bool
Any function determines if one or more of the slice-values satisfies the testFunc.
func ArrayContains ¶
ArrayContains check if a slice of generic type T contains/includes a Value of type T (for string, it's case-insensitive)
func ArrayContainsCaseSensitive ¶ added in v0.2.0
ArrayContainsCaseSensitive check if a slice of generic type T contains/includes a Value of type T (for string, it's case-sensitive)
func ArrayFloatContains ¶ added in v0.1.7
ArrayFloatContains check if a slice of int contains/includes a float Value
func ArrayIntContains ¶
ArrayIntContains check if a slice of int contains/includes an int Value
func ArrayMapToMapUnderscore ¶ added in v0.1.9
ArrayMapToMapUnderscore converts slice of map to map with underscore keys/fields.
func ArrayMapToStruct ¶ added in v0.1.9
ArrayMapToStruct converts []map/actParams to []struct/model-type
func ArrayStringContains ¶
ArrayStringContains check if a slice of string contains/includes a string Value, case-insensitive
func ArrayStringContainsCaseSensitive ¶ added in v0.2.0
ArrayStringContainsCaseSensitive check if a slice of string contains/includes a string Value, case-sensitive
func ArrayToSQLStringValues ¶ added in v0.1.9
ArrayToSQLStringValues transforms a slice of string to SQL-string-formatted-values
func CaseFieldToUnderscore ¶ added in v0.2.0
CaseFieldToUnderscore transforms camelCase or PascalCase name to underscore name, in lowercase
func ComparePassword ¶ added in v0.2.0
func ComparePassword2 ¶ added in v0.2.0
func ComputeTaskDuration ¶ added in v0.1.9
ComputeTaskDuration computes the task interval in microseconds
func ConvertByteSliceToBase64Str ¶ added in v0.1.9
ConvertByteSliceToBase64Str converts slice of byte to base64-string type.
func ConvertJsonBase64StringToMap ¶ added in v0.1.9
ConvertJsonBase64StringToMap converts the db-json-string-Value to the map-type On success, returns the resulting map-Value.
func ConvertJsonBase64StringToTypeValue ¶ added in v0.1.9
func ConvertJsonBase64StringToTypeValue(base64Str interface{}, typePointer interface{}) (interface{}, error)
ConvertJsonBase64StringToTypeValue converts the db-json-string-Value to the base-type. On success, store and returns the transformed/converted Value to the base-type address (typePointer).
func ConvertJsonStringToMapValue ¶ added in v0.1.9
ConvertJsonStringToMapValue converts the db-json-string-Value to the map-type. Returns map Value on success, or on error, returns map nil-Value and error.
func ConvertJsonStringToTypeValue ¶ added in v0.1.9
ConvertJsonStringToTypeValue converts the db-json-string-Value to the base-type. On success, store the transformed/converted Value to the base-type address (typePointer).
func ConvertStringToBase64Str ¶ added in v0.1.9
ConvertStringToBase64Str converts string Value to slice of byte.
func CurrencyNumFormatter ¶ added in v0.2.0
CurrencyNumFormatter format a number Value based on the specified currency and precision
func DivideScalarMatrix ¶ added in v0.2.0
DivideScalarMatrix function the matrix/matrices by the scalar Value.
func EncryptPassword ¶ added in v0.2.0
func ExcludeEmptyIdFields ¶ added in v0.1.9
ExcludeEmptyIdFields excludes fields with name id or ending with Id/ID/iD, with zero Value(""). Return the map record with id fields removed.
func ExcludeEmptyIdFromMapRecord ¶ added in v0.1.9
ExcludeEmptyIdFromMapRecord excludes id field with zero Value(""). Return the map record with id fields removed.
func ExcludeFieldFromMapRecord ¶ added in v0.1.9
ExcludeFieldFromMapRecord excludes the specified field name from the map record. Return the map record with the specified field removed.
func ExitOnError ¶
func ExitOnError(err error)
func FactNumGen ¶ added in v0.2.0
FactNumGen function generates series of the factorial Value of 1 to num.
func Factorial ¶ added in v0.2.0
Factorial function returns the factorial Value of 1 to num, using number-generator via channel.
func FactorialGen2 ¶
FactorialGen2 function returns the factorial Value of 1 to num, using simple iteration method.
func FactorialTail ¶
FactorialTail function returns the factorial Value from 1 to the specified limit (num). Accumulator Value should be set to 1 (default)
func FiboSeries ¶
FiboSeries function generates series of fibonacci numbers up to the specified limit (num).
func FiboTail ¶
FiboTail function returns last fibonacci numbers up to the limit (num). current and next parameters should be set to 0/1? (default) - TODO: review/clarify/test.
func Fibos ¶ added in v0.1.7
Fibos function returns slice of fibonacci numbers from 1 up to the specified limit (num).
func Filter ¶
Filter function returns the filtered-slice-Value, of type T, based on the filterFunc [generic].
func FilterGen ¶
FilterGen function returns series filtered-Value, of type T, based on the filterFunc [generic].
func GeometricMean ¶ added in v0.2.0
GeometricMean function returns the geometric mean of a slice of type float.
func GetHashValue ¶ added in v0.2.0
func GetLanguage ¶
GetLanguage returns the specified user-language or defaultLanguage as default
func GetParamsMessage ¶
func GetParamsMessage(msgObject MessageObject) mcresponse.ResponseMessage
GetParamsMessage compose the message-object into mcresponse.ResponseMessage.
func Index ¶ added in v0.1.7
Index functions returns the index of the specified Value (for string, it's case-insensitive)
func IndexCaseSensitive ¶ added in v0.2.0
IndexCaseSensitive functions returns the index of the specified Value (for string, it's case-sensitive)
func IsLeapYear ¶ added in v0.2.0
IsLeapYear determines if a given year is a leap year
func JsonToStruct ¶ added in v0.1.9
JsonToStruct converts json input, in []byte, to the equivalent struct data type specification rec must be a pointer to a type matching the jsonRec
func Map ¶
func Map[T ValueType](arr []T, mapFunc func(T) T, result []T)
Map function map slice of type T, by the mapFunc.
func MapFloat ¶ added in v0.1.7
MapFloat function returns the mapped-slice-Value, of type float64, based on the mapFunc.
func MapGen ¶
func MapGen[T ValueType](arr []T, mapFunc func(T) T, mapChan chan<- T)
MapGen function generates series of map Value of type T and send to the mapChan channel.
func MapString ¶ added in v0.1.7
MapString function returns the mapped-slice-Value, of type string, based on the mapFunc.
func MapToMapUnderscore ¶ added in v0.1.9
MapToMapUnderscore converts map camelCase-fields to underscore-fields
func MapToStruct ¶ added in v0.1.9
MapToStruct converts map to struct
func MapUnderscoreToMapCamelCase ¶ added in v0.2.0
MapUnderscoreToMapCamelCase converts map underscore-fields to camelCase-fields
func Max ¶
func Max[T Number](arr []T) T
Max function returns the maximum Value from a slice of type T (int or float).
func MeanSquareError ¶
func MeanSquareError()
func MeanSquareRootError ¶
func MeanSquareRootError()
func Min ¶
func Min[T Number](arr []T) T
Min function returns the minimum Value from a slice of type T (int or float).
func MinMax ¶
func MinMax[T Number](arr []T) (min T, max T)
MinMax function returns the minimum amd maximum values from a slice of type T (int or float).
func MultiplyMatrices ¶ added in v0.2.0
MultiplyMatrices function multiply two matrices. The number of rows in matrix1 sub-matrices must be the same as the number of columns in matrix2.
func MultiplyMatrix ¶ added in v0.2.0
MultiplyMatrix function multiply two matrices. The matrix1 single slice length must be the same as the number of columns in matrix2/sub-matrices.
func MultiplyScalarMatrix ¶ added in v0.2.0
MultiplyScalarMatrix function multiply a scalar Value with the matrix/matrices.
func NaturalNumbers ¶
NaturalNumbers function generates series positive numbers from 0 up to specified limit (num).
func NaturalNumbersGen ¶
NaturalNumbersGen function generates finite natural numbers.
func NaturalNumbersGenInf ¶
NaturalNumbersGenInf function generates infinite natural numbers.
func NumFormatter ¶ added in v0.2.0
NumFormatter format a number Value based on the specified precision
func PanicOnError ¶
func PanicOnError(err error)
func ParseRawValues ¶ added in v0.1.9
ParseRawValues process the raw rows/records from SQL-query
func PopulationStandardDeviation ¶ added in v0.2.0
PopulationStandardDeviation function returns the standard-deviation Value from a population/complete-data of slice of type float.
func PrimeNumbers ¶ added in v0.1.7
PrimeNumbers function returns the prime numbers up to the limit if num.
func Pythagoras ¶
Pythagoras function returns the number pairs and hypothesis values.
func PythagorasGen ¶
PythagorasGen function generates series the number pairs and hypothesis values.
func RandomNumbers ¶ added in v0.1.9
RandomNumbers generates random numbers using rand.Perm and returns []int as string
func RandomString ¶ added in v0.1.9
RandomString generates random string of characters and numbers
func Range ¶ added in v0.2.0
func Range[T Number](arr []T) T
Range function returns the range of the slice type of float.
func ReverseArray ¶
func ReverseArray[T ValueType](arr []T, result []T)
ReverseArray returns the reverse values of the specified array/slice [generic type]
func ReverseArrayFloat ¶
ReverseArrayFloat returns the reverse values of the specified array/slice of float64.
func ReverseArrayFloatGen ¶
ReverseArrayFloatGen sequentially generates reverse values of the specified array/slice of float64.
func ReverseArrayGenerator ¶ added in v0.2.0
func ReverseArrayGenerator[T ValueType](arr []T, arrChan chan<- T)
ReverseArrayGenerator sequentially generates reverse values of the specified array/slice [generic]
func ReverseArrayInt ¶
ReverseArrayInt returns the reverse values of the specified array/slice of int.
func ReverseArrayIntGen ¶
ReverseArrayIntGen sequentially generates reverse values of the specified array/slice of int.
func SampleStandardDeviation ¶ added in v0.2.0
SampleStandardDeviation function returns the standard-deviation Value from a sample-data of slice of type float.
func SeparatorFieldToCamelCase ¶ added in v0.2.0
SeparatorFieldToCamelCase transforms a separated/underscore name to camel-case name
func SeparatorFieldToPascalCase ¶ added in v0.2.0
SeparatorFieldToPascalCase transforms a separated/underscore field-name to pascal-case
func ShortString ¶
ShortString returns part of string, based on the specified maxLength
func StringToBool ¶
StringToBool returns the boolean Value of the specified string-Value
func StructToFieldValues ¶ added in v0.1.9
func StructToFieldValues(rec interface{}) (tableFields []string, fieldValues []interface{}, err error)
StructToFieldValues converts struct to record fields(underscore) and associated values - columns and values.
func StructToMap ¶ added in v0.1.9
StructToMap function transforms struct to map. Map keys match the json-fields of the struct data.
func StructToMapTag ¶ added in v0.2.0
StructToMapTag function converts struct to map (with key of tag/underscore name), for crud-db-table-record
func StructToMapUnderscore ¶ added in v0.1.9
StructToMapUnderscore converts struct to map (underscore_fields), for crud-db-table-record
func StructToMapUnderscoreData ¶ added in v0.2.0
StructToMapUnderscoreData transform a struct data type to the map[string]interface{} Value type, camelCase fields. map keys are converted to underscore types to match database-table-field/columns specs
func SubtractMatrices ¶ added in v0.2.0
SubtractMatrices function subtract two matrices of the same dimensions.
func SubtractMultipleMatrices ¶ added in v0.2.0
SubtractMultipleMatrices function [tensor] subtract multiple matrices of the same dimensions.
func SubtractScalarMatrix ¶ added in v0.2.0
SubtractScalarMatrix function subtracts a scalar Value from the matrix/matrices.
func TagField ¶ added in v0.1.9
TagField returns the field-tag (e.g. table-column-name) for mcorm/db/other tag, for the specified struct data fieldName.
func TransposeMatrix ¶ added in v0.2.0
TransposeMatrix function transpose the matrix - swap rows and columns, i.e. rotate the matrix around it's diagonal.
Types ¶
type ArrayOfFloat ¶
type ArrayOfFloat []float64
func (ArrayOfFloat) SetOfFloat ¶ added in v0.2.0
func (val ArrayOfFloat) SetOfFloat() []float64
type ArrayOfInt ¶
type ArrayOfInt []int
func (ArrayOfInt) SetOfInt ¶ added in v0.2.0
func (val ArrayOfInt) SetOfInt() []int
type ArrayOfString ¶
type ArrayOfString []string
func (ArrayOfString) SetOfString ¶ added in v0.2.0
func (val ArrayOfString) SetOfString() []string
type ArrayValue ¶
type ArrayValue[T ValueType] []T
func (ArrayValue[T]) Counter ¶ added in v0.2.0
func (val ArrayValue[T]) Counter() CounterResult[T]
Counter method returns the unique counts of the specified array/slice values[int, float, string and bool]
func (ArrayValue[T]) Set ¶ added in v0.2.0
func (val ArrayValue[T]) Set() []T
Set method returns the slice of set values for a generic type T
type BiConsumer ¶ added in v0.2.0
type BiFunction ¶ added in v0.2.0
type BinaryOperator ¶ added in v0.2.0
type BinaryOperator[T ValueType] func(val1 T, val2 T) T
type BinaryPredicate ¶ added in v0.2.0
type BoolSliceType ¶ added in v0.2.0
type BoolSliceType struct {
Value []bool `json:"Value"`
}
type Comparator ¶ added in v0.2.0
type CounterObjectValue ¶ added in v0.2.0
type CounterResult ¶ added in v0.2.0
type CounterResult[T ValueType] map[string]CounterValue[T]
type CounterValue ¶ added in v0.2.0
func Mode ¶ added in v0.2.0
func Mode[T Number](arr []T) []CounterValue[T]
Mode function returns the mode(most frequently occurring Value(s)) of a slice of type float.
type FloatPredicate ¶ added in v0.2.0
type FloatSliceType ¶ added in v0.2.0
type FloatSliceType struct {
Value []float64 `json:"value"`
}
func (*FloatSliceType) ArrayFloatContains ¶ added in v0.2.0
func (arr *FloatSliceType) ArrayFloatContains(queryVal float64) bool
ArrayFloatContains method check if a slice of int contains/includes a float Value
func (*FloatSliceType) MapFloat ¶ added in v0.2.0
func (arr *FloatSliceType) MapFloat(mapFunc func(float64) float64, result []float64)
MapFloat method returns the mapped-slice-Value, of type float64, based on the mapFunc.
func (*FloatSliceType) ReverseArrayFloat ¶ added in v0.2.0
func (arr *FloatSliceType) ReverseArrayFloat(result []float64)
ReverseArrayFloat returns the reverse values of the specified array/slice of float64.
func (*FloatSliceType) ReverseArrayFloatGen ¶ added in v0.2.0
func (arr *FloatSliceType) ReverseArrayFloatGen(arrChan chan<- float64)
ReverseArrayFloatGen sequentially generates reverse values of the specified array/slice of float64.
type FrequencyResult ¶ added in v0.2.0
type FrequencyResult struct { Result []FrequencyValue `json:"result"` Interval float64 `json:"interval"` }
type FrequencyValue ¶ added in v0.2.0
type GenericSliceType ¶ added in v0.2.0
type GenericSliceType[T ValueType] struct { Value []T `json:"Value"` }
func (*GenericSliceType[T]) All ¶ added in v0.2.0
func (arr *GenericSliceType[T]) All(testFunc TestFuncType[T]) bool
All method determines if all the slice-values satisfies the testFunc.
func (*GenericSliceType[T]) Any ¶ added in v0.2.0
func (arr *GenericSliceType[T]) Any(testFunc TestFuncType[T]) bool
Any method determines if one or more of the slice-values satisfies the testFunc.
func (*GenericSliceType[T]) ArrayContains ¶ added in v0.2.0
func (arr *GenericSliceType[T]) ArrayContains(queryVal T) bool
ArrayContains method check if a slice of generic type T contains/includes a Value of type T (for string, it's case-insensitive)
func (*GenericSliceType[T]) ArrayContainsCaseSensitive ¶ added in v0.2.0
func (arr *GenericSliceType[T]) ArrayContainsCaseSensitive(str T) bool
ArrayContainsCaseSensitive check if a slice of generic type T contains/includes a Value of type T (for string, it's case-sensitive)
func (*GenericSliceType[T]) Filter ¶ added in v0.2.0
func (arr *GenericSliceType[T]) Filter(filterFunc func(T) bool, result []T)
Filter method returns the filtered-slice-Value, of type T, based on the filterFunc [generic].
func (*GenericSliceType[T]) FilterGen ¶ added in v0.2.0
func (arr *GenericSliceType[T]) FilterGen(filterFunc func(T) bool, filterChan chan<- T)
FilterGen method returns series filtered-Value, of type T, based on the filterFunc [generic].
func (*GenericSliceType[T]) Index ¶ added in v0.2.0
func (arr *GenericSliceType[T]) Index(queryVal T) int
Index method returns the index of the specified Value (for string, it's case-insensitive)
func (*GenericSliceType[T]) IndexCaseSensitive ¶ added in v0.2.0
func (arr *GenericSliceType[T]) IndexCaseSensitive(val T) int
IndexCaseSensitive method returns the index of the specified Value (for string, it's case-sensitive)
func (*GenericSliceType[T]) Map ¶ added in v0.2.0
func (arr *GenericSliceType[T]) Map(mapFunc func(T) T, result []T)
Map method returns the mapped-slice-Value, of type T, based on the mapFunc [generic].
func (*GenericSliceType[T]) MapGen ¶ added in v0.2.0
func (arr *GenericSliceType[T]) MapGen(mapFunc func(T) T, mapChan chan<- T)
MapGen returns series of the mapped-Value, of type T, based on the mapFunc [generic].
func (*GenericSliceType[T]) ReverseArray ¶ added in v0.2.0
func (arr *GenericSliceType[T]) ReverseArray(result []T)
ReverseArray method returns the reverse values of the specified array/slice [generic type]
func (*GenericSliceType[T]) ReverseArrayGenerator ¶ added in v0.2.0
func (arr *GenericSliceType[T]) ReverseArrayGenerator(arrChan chan<- T)
ReverseArrayGenerator sequentially generates reverse values of the specified array/slice [generic]
func (*GenericSliceType[T]) Take ¶ added in v0.2.0
func (arr *GenericSliceType[T]) Take(num uint, result []T)
Take method returns num of the arr slice of type T [generic].
func (*GenericSliceType[T]) TakeGen ¶ added in v0.2.0
func (arr *GenericSliceType[T]) TakeGen(num uint, takeChan chan<- T)
TakeGen method returns num series of values, of type T [generic].
type GenericType ¶ added in v0.2.0
type GenericType[T ValueType] struct { Value T `json:"value"` }
type IntPredicate ¶ added in v0.2.0
type IntSliceType ¶ added in v0.2.0
type IntSliceType struct {
Value []int `json:"Value"`
}
func (*IntSliceType) ArrayIntContains ¶ added in v0.2.0
func (arr *IntSliceType) ArrayIntContains(queryVal int) bool
ArrayIntContains method check if a slice of int contains/includes an int Value
func (*IntSliceType) MapInt ¶ added in v0.2.0
func (arr *IntSliceType) MapInt(mapFunc func(int) int, result []int)
MapInt method returns the mapped-slice-Value of type int, based on the mapFunc.
func (*IntSliceType) ReverseArrayInt ¶ added in v0.2.0
func (arr *IntSliceType) ReverseArrayInt(result []int)
ReverseArrayInt method returns the reverse values of the specified array/slice of int.
func (*IntSliceType) ReverseArrayIntGen ¶ added in v0.2.0
func (arr *IntSliceType) ReverseArrayIntGen(arrChan chan<- int)
ReverseArrayIntGen sequentially generates reverse values of the specified array/slice of int.
type Locale ¶
type Locale map[string]interface{}
func GetLocale ¶ added in v0.2.0
func GetLocale(localeFiles LocaleFilesType, options LocaleOptions) Locale
GetLocale function returns the locale for the specified language
type LocaleContent ¶
type LocaleContent map[string]interface{}
type LocaleFilesType ¶ added in v0.2.0
type LocaleFunc ¶ added in v0.2.0
type LocaleFunc func(val interface{}) interface{}
type LocaleOptions ¶
type LocaleValueType ¶ added in v0.2.0
type LocaleValueType interface { ValueType | LocaleFunc }
type MessageObject ¶
type NumberPredicate ¶ added in v0.2.0
type ObjectCounterResult ¶ added in v0.2.0
type ObjectCounterResult[T map[string]interface{} | struct{}] map[string]CounterObjectValue[T]
type ObjectType ¶ added in v0.2.0
type ObjectType map[string]interface{}
type QuartilesType ¶ added in v0.2.0
type QuartilesType struct { Min float64 `json:"min"` // Lowest value Q1 float64 `json:"q1"` Q2 float64 `json:"q2"` // Median Q3 float64 `json:"q3"` Q4 float64 `json:"q4"` // Highest value, Max IQR float64 `json:"IQR"` Max float64 `json:"max"` // Highest value, Q4 Range float64 `json:"range"` // Q3 - Q1 }
func Deciles ¶ added in v0.2.0
func Deciles[T Number](arr []T) QuartilesType
Deciles returns slice-values that separate the data into 10 equal parts (quantiles). TODO: review/complete. Examples: 10%, 20%[Q2], 30%[Q3]... 100%
func IQRange ¶ added in v0.2.0
func IQRange[T Number](arr []T) QuartilesType
IQRange InterQuartileRange returns the difference between the first and third quartiles (Q1 and Q3), including quartile-values[Q0/min, Q1/25%, Q2/50%(median), Q3/75% & Q4/max].
func Percentiles ¶ added in v0.2.0
func Percentiles[T Number](arr []T) QuartilesType
Percentiles returns slice-values that separate the data into 100 equal parts (quantiles). TODO: review/complete. Examples: 1%, 2%, 3%... 100%.
type SliceObjectType ¶ added in v0.2.0
type SliceObjectType[T map[string]interface{}] []T
func (SliceObjectType[T]) SliceObjectCounter ¶ added in v0.2.0
func (val SliceObjectType[T]) SliceObjectCounter() ObjectCounterResult[T]
SliceObjectCounter method returns the unique counts of the specified array/slice of map[string]interface{} values
type StatFrequencyResult ¶ added in v0.2.0
type StatFrequencyResult struct { Result []StatFrequencyValue `json:"result"` Interval float64 `json:"interval"` }
func StatFrequency ¶ added in v0.2.0
func StatFrequency[T Number](arr []T, interval float64, valueLabel string) StatFrequencyResult
StatFrequency function returns the frequency / relative / cumulative / relative-cumulative frequencies of a slice of type float.
type StatFrequencyValue ¶ added in v0.2.0
type StatFrequencyValue struct { Label string `json:"label"` Value float64 `json:"value"` Frequency int `json:"frequency"` RelativeFrequency float64 `json:"relativeFrequency"` CumulativeFrequency int `json:"cumulativeFrequency"` CumulativeRelativeFrequency float64 `json:"cumulativeRelativeFrequency"` }
type StringPredicate ¶ added in v0.2.0
type StringSliceType ¶ added in v0.2.0
type StringSliceType struct {
Value []string `json:"value"`
}
func (*StringSliceType) ArrayStringContains ¶ added in v0.2.0
func (arr *StringSliceType) ArrayStringContains(queryVal string) bool
ArrayStringContains method check if a slice of string contains/includes a string Value, case-insensitive
func (*StringSliceType) ArrayStringContainsCaseSensitive ¶ added in v0.2.0
func (arr *StringSliceType) ArrayStringContainsCaseSensitive(val string) bool
ArrayStringContainsCaseSensitive method check if a slice of string contains/includes a string Value, case-sensitive
type StringType ¶ added in v0.2.0
type StringType struct {
Value string `json:"Value"`
}
type TestFuncType ¶ added in v0.2.0
type UnaryOperator ¶ added in v0.2.0
type UnaryOperator[T ValueType] func(val1 T) T