util

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtArrayPosition

func AtArrayPosition(val interface{}, array interface{}) (index int)

AtArrayPosition find the int position of val in a Slice

func ConnectStorm

func ConnectStorm(dbFilePath string) *storm.DB

ConnectStorm Create database connection

func CreateDirIfNotExist

func CreateDirIfNotExist(dir string)

CreateDirIfNotExist creates a directory if not found

func FatalIfError

func FatalIfError(err error, msgOrPattern string, args ...interface{})

FatalIfError logs the error and Exit program on Error

func GetEnvInt

func GetEnvInt(key string, defaultVal int) int

GetEnvInt finds an ENV variable and converts to int, otherwise return default value

func GetEnvStr

func GetEnvStr(key, defaultVal string) string

GetEnvStr finds an ENV variable, otherwise return default value

func InArray

func InArray(val interface{}, array interface{}) bool

InArray checks is val exists in a Slice

func LogIfError

func LogIfError(err error, msgOrPattern string, args ...interface{}) bool

LogIfError logs the error and returns true on Error. think as IfError

func UnixToTime

func UnixToTime(timestamp string) time.Time

UnixToTime create time.Time from string timestamp

Types

This section is empty.

Jump to

Keyboard shortcuts

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