commons

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package commons assemble all useful functions used in other packages

Index

Constants

This section is empty.

Variables

View Source
var (
	// SqlDriver var retrieve OS env var
	SqlDriver = strings.TrimSpace(os.Getenv("SQL_DRIVER"))
)

Functions

func BuildDSN

func BuildDSN() string

BuildDSN permit to create string url to connect to the sql instance

func GetMD5HashWithSum

func GetMD5HashWithSum(text string) string

GetMD5HashWithSum function is explicit

func GetPagination

func GetPagination(page int, start int, end int, rangeLimit int) (startLimit int, EndLimit int)

GetPagination function is explicit

func GetRedisURI

func GetRedisURI() string

GetRedisURI func permit to check OS env var exist

func RandomInt

func RandomInt(min int, max int) int

RandomInt function is explicit

func RandomValueFromArray

func RandomValueFromArray(array []string) string

RandomValueFromArray function is explicit

func RedisEnabled

func RedisEnabled() (b bool)

RedisEnabled func permit to check OS env var exist

Types

This section is empty.

Jump to

Keyboard shortcuts

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