utils

package
v0.0.0-...-e10a309 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

package utils provides general utility function that can be used across packages (thus this package does not have dependency on any other package)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructSliceOfInt64IntoString

func ConstructSliceOfInt64IntoString(collection []int64, separator string) string

ConstructSliceOfInt64IntoString create a string from slice of int64 with a custom separator

func ConvertSliceOfStringIntoSliceOfInt64

func ConvertSliceOfStringIntoSliceOfInt64(collection []string) []int64

ConvertSliceOfStringIntoSliceOfInt64 converts slice of string into slice of int64

func GeneratePostgreURL

func GeneratePostgreURL(dbAcc resources.DBAccount) string

GeneratePostgreURL generates postgresql URL from DB Account struct

func GetBool

func GetBool(input string) bool

GetBool is a func to get bool from a string

func GetErrorResponse

func GetErrorResponse(message string, statusCode int, code string) *resources.ApplicationError

GetErrorResponse is a function for build errorMessage

func GetFuncName

func GetFuncName() string

GetFuncName is a func to get func name from runtime

func GetInt

func GetInt(input string) int

GetInt is a func to get int from a string

func GetInt64

func GetInt64(input string) int64

GetInt64 is a func to get int64 from a string

func GetUniqueElementsSliceOfString

func GetUniqueElementsSliceOfString(collection []string) []string

GetUniqueElementsSliceOfString gets unique element of a slice of string

func Maxint

func Maxint(a int, b int) int

func RespondWithError

func RespondWithError(c *gin.Context, status int, data interface{})

RespondWithError for sending response with status not 200

func ResponseJSON

func ResponseJSON(c *gin.Context, data interface{})

ResponseJSON for sending response with status 200

Types

This section is empty.

Jump to

Keyboard shortcuts

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