Documentation
¶
Index ¶
- func CompareFloats(x float64, y float64) (max float64, min float64)
- func CompareSliceInts(newslice []int, master []int) (idx []int)
- func DeltaF(floats []float64) []float64
- func DeltaI(ints []int) []int
- func Dropna(slice []float64) []float64
- func EnsureFolder(root string) string
- func ExtractSources(input string) [3]int
- func FileExists(filename string) bool
- func Fillna(slice []float64, method string, prefill bool, validTime int) []float64
- func Find(slice []string, val string) (int, bool)
- func FindFloatIndex(slice []float64, val float64) int
- func FindInt(slice []int, val int) (int, bool)
- func FindStringposition(slice []string, s string) int
- func FirstOfMonth(t time.Time) time.Time
- func GetEnvOrDefault(key string, defaultValue string) string
- func GetSysmemory() float64
- func InsertIntoSlice(slice []float64, idx int, val float64) []float64
- func IsValidFloat(value float64) bool
- func MatchAll(a string, url string) (paramsMap map[string]string)
- func MaxI(a int, b int) int
- func MinI(a int, b int) int
- func NanSlice(size int) (nanslice []float64)
- func NanosecondsToTime(tm int64) time.Time
- func Numberrange(start int, end int, step int) (numberrange []float64)
- func ParseTime(t string) time.Time
- func PrettyByte(bytes []byte) string
- func RandRange(min int, max int) int
- func ReplaceNan(value float64, replacewith float64) float64
- func ReplaceNanSlice(values []float64, replacewith float64) []float64
- func RoundTo(val float64, digits int) float64
- func SetDefaultF(defaultval float64, confval float64) float64
- func SetDefaultI(defaultval int, confval int) int
- func SliceContains(slice []string, s string) bool
- func SliceNumberContains(slice []int, s int) bool
- func StringInSlice(slice []string, s string, ignorecase bool) bool
- func StringToFloat64(s string) float64
- func StringToInt(s string) int
- func StringToTime(t string) time.Time
- func TimeToMicroseconds(tm time.Time) int64
- func TimeToString(t time.Time) string
- func UniqueInts(t []int) []int
- func UniqueStrings(t []string) []string
- func Use(v interface{}) string
- func Xnor(a, b bool) bool
- type Rounded
- type TimeMeasure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareFloats ¶
CompareFloats returns maximum and minimum of two floats taking NaNs into account
func CompareSliceInts ¶
CompareSliceInts CompareSliceInts
func ExtractSources ¶
ExtractSources returns the levels a,b,c as integer list
func Fillna ¶
Fillna Fills NaN values with a value base on method. method "previous" fills with previous value,method "linear" fills the NaNs with linear interpolation If no previous value found for filling, first valid value can be used by setting prefill=true validTime (higher number than 1) sets the sample's lifetime. If the sample "dies", NaN is written. This overrides prefill = true -setting
func FindFloatIndex ¶
FindFloatIndex finds the index of first occurrence of the given value
func FindStringposition ¶
FindStringposition returns the first occurrence index of given string. Returns -1 if string was not found.
func FirstOfMonth ¶
FirstOfMonth returns a TZ timestamp of first day of given month
func GetSysmemory ¶
func GetSysmemory() float64
func InsertIntoSlice ¶
InsertIntoSlice InsertIntoSlice
func IsValidFloat ¶
IsValidFloat checks whether the given float is a valid number instead of NaN or Inf
func MatchAll ¶
MatchAll MatchAll example: Avant(?P<DeviceID>\d{1,})(_S(?P<SlaveID>\d{1,})_C(?P<CellID>\d{1,}))?
func NanosecondsToTime ¶
NanosecondsToTime NanosecondsToTime
func Numberrange ¶
Numberrange creates a slice with numbers from start to end, with given step (integer)
func ReplaceNan ¶
ReplaceNan Replaces NaN and Inf with given value
func ReplaceNanSlice ¶
ReplaceNanSlice Replace NaNs in a slice with given value
func SetDefaultF ¶
SetDefaultF set default value for a parameter, if the configuration value is zero (=initialized empty variable)
func SetDefaultI ¶
SetDefaultI set default value for a parameter, if the configuration value is zero (=initialized empty variable)
func SliceNumberContains ¶
SliceNumberContains SliceNumberContains
func StringToFloat64 ¶
func TimeToMicroseconds ¶
TimeToMicroseconds TimeToMicroseconds
func UniqueInts ¶
UniqueInts returns unique ints from given slice of ints
func UniqueStrings ¶
UniqueStrings returns unique strings from given slice of strings
Types ¶
type Rounded ¶
type Rounded struct {
Rawvalue float64 // raw value with given digits
Prefix string // prefix string
Value float64 // rounded value with given digits and prefix
Response string // response as <Value> <Prefix><unit>
}
func RoundPrefix ¶
RoundPrefix returns the rounded value to given digits and correct prefix (Megas, Kilos etc.) Special case is abs value between 1000....10000 which is not converted to kilos (because I like it like that) set prefix to force certain prefix, otherwise the function figures it out on its' own.
type TimeMeasure ¶
type TimeMeasure struct {
// contains filtered or unexported fields
}
TimeMeasure GoPython
func (*TimeMeasure) GetMilliseconds ¶
func (t *TimeMeasure) GetMilliseconds() int64
GetMilliseconds GetMilliseconds