goutils

package module
v0.0.0-...-35aecd4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: BSD-2-Clause Imports: 11 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

CheckPasswordHash returns a boolean value comparing the passed strings (password and hash)

func ClearStringOfCharacters

func ClearStringOfCharacters(str string, characters []string) string

ClearStringOfCharacters in the passed string, replaces the characters from the passed slice with an empty string.

func CompareMapsByStringKeys

func CompareMapsByStringKeys(map1, map2 map[string]string) bool

CompareMapsByStringKeys for map-arguments, checks the keys of the first argument that contain non-empty values ​​to see if they are present in the second argument.

func ConcatSlice

func ConcatSlice(strSlice []string) string

ConcatSlice returns a string from the elements of the passed slice with strings. Separator - space.

func GCRunAndPrintMemory

func GCRunAndPrintMemory()

GCRunAndPrintMemory runs a garbage collection and if setting the APP_ENV environment variable as "dev" prints currently allocated number of bytes on the heap.

func GetConfFromEnvFile

func GetConfFromEnvFile(filename string) map[string]string

GetConfFromEnvFile receives data for the database from the environment file. If successful, returns a non-empty map.

func GetIndexByStrValue

func GetIndexByStrValue(data []string, value string) int

GetIndexByStrValue returns the integer index of the passed value in the passed slice; if the value is missing, then -1.

func GetMapKeys

func GetMapKeys(argMap map[string]string) []string

GetMapKeys returns a slice of the keys of the passed map.

func GetMapKeysWithValue

func GetMapKeysWithValue(mapArg map[string]string) []string

GetMapKeysWithValue returns from the argument map, a map with keys with non-empty values.

func GetMapValues

func GetMapValues(mapArg map[string]string) []string

GetMapValues from the passed map returns a slice with its non-empty values.

func GetMapWithoutKeys

func GetMapWithoutKeys(map1 map[string]string, exceptKeys []string) map[string]string

GetMapWithoutKeys returns the transferred map without the transferred key.

func HashPassword

func HashPassword(password string) (string, error)

HashPassword returns the hash of the passed string and a possible error.

func IsEmail

func IsEmail(email string) bool

IsEmail returns a boolean value checking the passed string against the pattern of matching the email address.

func LogInit

func LogInit(path string)

LogInit using the passed path string, creates, if missing, a log file and assigns errors to be output to it.

func Logging

func Logging(errors ...error)

Logging writes an indefinite number of transmitted non-empty errors to the log.

func PresenceMapKeysInOtherMap

func PresenceMapKeysInOtherMap(map1, map2 map[string]string) bool

PresenceMapKeysInOtherMap returns a Boolean answer whether the keys of the first passed card are contained in the second.

func SqlToMap

func SqlToMap(rows *sql.Rows) []map[string]any

SqlToMap the values ​​of the passed response structure are returned by the database as a map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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