utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayToString

func ArrayToString(a []int, delim string) string

ArrayToString convert a array to string.

func CheckError

func CheckError(err error)

CheckError - Verify if exists any error

func GetBoolFromEnv

func GetBoolFromEnv(key string, defaultValue bool) (bool, error)

GetBoolFromEnv get a bool value from a Environment Variable, if error or environment variable not exist, the default value will be returned.

func GetIntFromEnv

func GetIntFromEnv(key string, defaultValue int) (int, error)

GetIntFromEnv get a int value from a Environment Variable, if error or environment variable not exist, the default value will be returned.

func GetKeysFromMap

func GetKeysFromMap(object map[string]string) []string

GetKeysFromMap return all map keys from a map

func InterfaceToString

func InterfaceToString(obj interface{}) string

InterfaceToString Convert Interce to string and return

func NullableFloat

func NullableFloat(value float64) sql.NullFloat64

NullableFloat validate null for float

func NullableInt

func NullableInt(value int) sql.NullInt64

NullableInt validate null for int

func NullableString

func NullableString(value string) sql.NullString

NullableString validate null for string

func ObjectToJSON

func ObjectToJSON(obj interface{}) string

ObjectToJSON return string object json

func PrintJSON

func PrintJSON(obj interface{})

PrintJSON print in terminal console, object in json

func ValueInArray

func ValueInArray(array []interface{}, value interface{}) bool

ValueInArray validate the existence of a value in Array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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