utils

package
v0.0.0-...-ae3587a Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertDateStrToTime

func ConvertDateStrToTime(dateStr string) (time.Time, error)

ConvertDateStrToTime converts a dateStr to a time.Time obj

func ConvertIntToBool

func ConvertIntToBool(value int) bool

ConvertIntToBool converts an integer to a bool (binary)

func GetBoolFromEnvWithDefault

func GetBoolFromEnvWithDefault(enVarName string, defaultValue bool) bool

GetBoolFromEnvWithDefault parses an OS Environment Variable as bool

func GetMultipleStringsFromEnvWithDefault

func GetMultipleStringsFromEnvWithDefault(envVarName string, defaultValue []string) []string

func GetNumberFromEnvWithDefault

func GetNumberFromEnvWithDefault(envVarName string, defaultValue int) int

GetNumberFromEnvWithDefault returns default Value if OS Environment Variable is not set

func GetStringFromEnvWithDefault

func GetStringFromEnvWithDefault(enVarName, defaultValue string) string

GetStringFromEnvWithDefault returns default Value if OS Environment Variable is not set

func MustBeNil

func MustBeNil(err error)

MustBeNil panics if err != nil

func MustGetStringFromEnv

func MustGetStringFromEnv(enVarName string) string

MustGetStringFromEnv panics if OS Environment Variable is not set

func PanicIfNotNil

func PanicIfNotNil(err error)

PanicIfNotNil panics if err != nil

func RandUUIDSeq

func RandUUIDSeq() string

RandUUIDSeq returns a random uuid string

func WithRetries

func WithRetries(times int, f func() error) error

WithRetries calls f up to the given `times` and returns the last error if times is reached

Types

type Neo4jConfig

type Neo4jConfig struct {
	Host     string
	Username string
	Password string
}

Neo4jConfig holds all necessary informations to connect to a neo4j database

func GetNeo4jConfig

func GetNeo4jConfig() *Neo4jConfig

getNeo4jConfig returns a initialized Neo4jConfig object by reading the values from env variables

Jump to

Keyboard shortcuts

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