Documentation ¶
Index ¶
- func ConvertInterfaceToBool(value interface{}) (bool, error)
- func ConvertInterfaceToFloat(value interface{}) (float64, error)
- func ConvertInterfaceToSlice(value interface{}) interface{}
- func ConvertInterfaceToString(value interface{}) (string, error)
- func CurrFuncName() string
- func CurrVersion() string
- func DecodeJWT(c echo.Context, claims jwt.Claims, secret string) error
- func DeleteStringFromSlice(slice []string, index int) []string
- func EncodeJWT(claims jwt.Claims, secret string) (string, error)
- func ExtractJWTFromHeader(c echo.Context) string
- func FindStringInSlice(slice []string, str string) int
- func FloatInRange(i, min, max float64) float64
- func GetRandomNumberFromRange(min, max int) int
- func HasStringInSlice(slice []string, str string, modifier func(str string) string) bool
- func InterfaceStripTags(data interface{}, trimSpace bool) interface{}
- func IsFilesExistInDirectory(dir string, filesToCheck []string) (bool, error)
- func JitterBackoff(min, max time.Duration, attempt int) time.Duration
- func Max[T Int | Float](x, y T) T
- func ParseBeanSystemFilesAndDirectorires()
- func PostDataStripTags(c echo.Context, trimSpace bool) (map[string]interface{}, error)
- func SingleDoChan[T any](ctx context.Context, key string, call func() (T, error), retry int, ...) (data T, err error)
- func StructStripTags(data interface{}, trimSpace bool) error
- type CopyableMap
- type CopyableSlice
- type Float
- type Int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertInterfaceToBool ¶ added in v1.1.39
ConvertInterfaceToBool will convert an interface `value` into boolean. The `value` is also supporting pointer interface.
func ConvertInterfaceToFloat ¶ added in v1.1.39
ConvertInterfaceToFloat will convert an interface `value` into float. The `value` is also supporting pointer interface.
func ConvertInterfaceToSlice ¶ added in v1.1.39
func ConvertInterfaceToSlice(value interface{}) interface{}
ConvertInterfaceToSlice will convert an interface `value` into slice. The `value` is also supporting pointer interface.
func ConvertInterfaceToString ¶ added in v1.1.39
ConvertInterfaceToString will convert an interface `value` into string. The `value` is also supporting pointer interface.
func CurrFuncName ¶
func CurrFuncName() string
CurrFuncName return the name of the current running function.
func CurrVersion ¶
func CurrVersion() string
CurrVersion will return the current version, only support module mode binaries.
func DeleteStringFromSlice ¶ added in v1.1.11
DeleteStringFromSlice will delete a string from a specific index of a slice.
func EncodeJWT ¶
EncodeJWT will encode JWT `claims` using a secret string and return a signed token as string.
func ExtractJWTFromHeader ¶
func ExtractJWTFromHeader(c echo.Context) string
ExtractJWTFromHeader will extract JWT from `Authorization` HTTP header and returns as string.
func FindStringInSlice ¶ added in v1.1.10
FindStringInSlice returns the smallest index at which str == slice[index], or -1 if there is no such index.
func FloatInRange ¶
FloatInRange will return the floating point number provided in `i` if the number is between min and max. If `i` is less than `min` then it will return min number. If `i` is greater than `max` then it will return max.
func GetRandomNumberFromRange ¶
GetRandomNumberFromRange will generate and return a random integer from a range.
func HasStringInSlice ¶ added in v1.1.10
if !slice.HasStringInSlice(src, "ee", modifier) { }
func InterfaceStripTags ¶
func InterfaceStripTags(data interface{}, trimSpace bool) interface{}
func IsFilesExistInDirectory ¶
IsFilesExistInDirectory will check a file(s) is exist in a specific diretory or not. If you pass multiple files into `filesToCheck` slice then this function will chcek the existence of all those files. If one of the file doesn't exist, it will return `false`.
func JitterBackoff ¶ added in v1.1.38
select { case <-time.After(waitTime): case <-c.Done(): return c.Err() } }
func Max ¶ added in v1.1.45
Max returns a greater number of x and y, otherwise y. It supports only type parameters comparable with order operators (`<`, `<=`, `>` and `>=`).
func ParseBeanSystemFilesAndDirectorires ¶
func ParseBeanSystemFilesAndDirectorires()
func PostDataStripTags ¶
func SingleDoChan ¶ added in v1.3.0
func StructStripTags ¶
helpers.StructStripTags(&test, true)
Types ¶
type CopyableMap ¶
type CopyableMap map[string]interface{}
func (CopyableMap) DeepCopy ¶
func (m CopyableMap) DeepCopy() map[string]interface{}
DeepCopy will create a deep copy of this map. The depth of this copy is all inclusive. Both maps and slices will be considered when making the copy. Keep in mind that the slices in the resulting map will be of type []interface{}, so when using them, you will need to use type assertion to retrieve the value in the expected type. Reference: https://stackoverflow.com/questions/23057785/how-to-copy-a-map/23058707
type CopyableSlice ¶
type CopyableSlice []interface{}
func (CopyableSlice) DeepCopy ¶
func (s CopyableSlice) DeepCopy() []interface{}
DeepCopy will create a deep copy of this slice. The depth of this copy is all inclusive. Both maps and slices will be considered when making the copy. Reference: https://stackoverflow.com/questions/23057785/how-to-copy-a-map/23058707