utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ALLVARS map[string][]string
View Source
var TEMPPATH string

Functions

func CopyMapGob

func CopyMapGob(m map[string]interface{}) (map[string]interface{}, error)

Map performs a deep copy of the given map m.

func CreateDirIfNotExist

func CreateDirIfNotExist(dir string)

func DeepCopyJSON

func DeepCopyJSON(src map[string]interface{}, dest map[string]interface{})

func Duration

func Duration(invocation time.Time, name, pkg, desc string)

func GetFloat

func GetFloat(num interface{}) (float64, error)

func GetSHA1Hash

func GetSHA1Hash(s string) string

GetSHA1Hash return the SHA1 of a string

func InitLogger

func InitLogger(lconf LogConf)

init Initialise le module de Logging de vigie. L'instance crée sera accessible par tout les packages

func IsArray

func IsArray(s string) bool

func IsBool

func IsBool(s string) bool

func IsDuration

func IsDuration(s string) bool

func IsJSONString

func IsJSONString(s string) bool

func IsNestedArray

func IsNestedArray(s string) bool

func IsNumeric

func IsNumeric(s string) bool

func MapStringEquals

func MapStringEquals(a, b map[string]string) bool

func MergeMaps

func MergeMaps(globalVar map[string][]string, tsVars ...map[string][]string) map[string][]string

MergeMaps merge 2 maps, in case of duplicate: the second map arg will overwrite the value.

func ParseDuration

func ParseDuration(durationStr string) (time.Duration, error)

Use time.ParseDuration instead

func StringInSlice

func StringInSlice(a string, list []string) bool

Types

type LogConf

type LogConf struct {
	Stdout      bool   `toml:"stdout"`
	Format      string `toml:"format"`
	LogFile     bool   `toml:"logfile"`
	Level       string `toml:"level"`
	FilePath    string `toml:"filePath"`
	Environment string `toml:"environment"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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