helper

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: LGPL-3.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureStdout

func CaptureStdout(f func()) string

CaptureStdout is used to get what is logged

func CopyMap

func CopyMap(originalMap map[string]interface{}) map[string]interface{}

CopyMap copies a map in a new one

func DeleteValueFromStruct

func DeleteValueFromStruct(key string, object interface{}) error

DeleteValueFromStruct filters struct properties Solution taken from Sarath Sadasivan Pillai => https://sarathsp.com/ Modified for our needs

func ErrorPrint

func ErrorPrint(str string) error

ErrorPrint returns error from string

func ErrorPrintf

func ErrorPrintf(str string, args ...interface{}) error

ErrorPrintf returns go error from formater

func GetQueryVars

func GetQueryVars(r *http.Request) url.Values

GetQueryVars gets variables from query string

func GetRouteVars

func GetRouteVars(r *http.Request) map[string]string

GetRouteVars gets variables from URL

func InArray

func InArray(needle interface{}, haystack interface{}) (bool, int)

InArray searches for a value from interface

func LoadEnvFile

func LoadEnvFile(env string) error

LoadEnvFile loads env var from file

func SliceDiff

func SliceDiff(refKeys, toDelete []string) []string

SliceDiff returns a diff between two slice

func StringInSlice

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

StringInSlice searches value in slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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