utils

package module
v0.0.0-...-b8a00e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(i int) int

func CheckErr

func CheckErr(e error)

func DrawChart

func DrawChart(timestamps [][]time.Time, datas [][]float64, chartName string, seriesNames []string)

func FindIntInSlice

func FindIntInSlice(val int64, slice []int64) (isFound bool)

FindIntInSlice allows to find an int in a slice

func FindStringInSlice

func FindStringInSlice(val string, slice []string) (isFound bool)

FindStringInSlice allows to find a string in a slice

func FormatDate

func FormatDate(timestamp int64, format string) (ret string)

FormatDate allows to format a date

func GenerateTimestampArray

func GenerateTimestampArray(startTS, endTS int64) (tsArray []int64)

GenerateTimestampArray allows to generate a Timestamp array

func Haversine

func Haversine(lonFrom float64, latFrom float64, lonTo float64, latTo float64) (distance float64)

func LineCounter

func LineCounter(r io.Reader) (int, error)

func Log

func Log(ctxt context.Context, level string, msg ...interface{})

Log logs if debug env var is set at true

func OpenCSV

func OpenCSV(fileName string) (ret [][]float64)

func OpenJSON

func OpenJSON(fileName string) (ret interface{})

func RemoveStringFromSlice

func RemoveStringFromSlice(s []string, r string) []string

func SaveJSON

func SaveJSON(fileName string, data interface{}, separator string)

func ToTitle

func ToTitle(s string) string

ToTitle is a replacement of strings.Title

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL