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 ¶
- func ConstructSliceOfInt64IntoString(collection []int64, separator string) string
- func ConvertSliceOfStringIntoSliceOfInt64(collection []string) []int64
- func GeneratePostgreURL(dbAcc resources.DBAccount) string
- func GetBool(input string) bool
- func GetErrorResponse(message string, statusCode int, code string) *resources.ApplicationError
- func GetFuncName() string
- func GetInt(input string) int
- func GetInt64(input string) int64
- func GetUniqueElementsSliceOfString(collection []string) []string
- func Maxint(a int, b int) int
- func RespondWithError(c *gin.Context, status int, data interface{})
- func ResponseJSON(c *gin.Context, data interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructSliceOfInt64IntoString ¶
ConstructSliceOfInt64IntoString create a string from slice of int64 with a custom separator
func ConvertSliceOfStringIntoSliceOfInt64 ¶
ConvertSliceOfStringIntoSliceOfInt64 converts slice of string into slice of int64
func GeneratePostgreURL ¶
GeneratePostgreURL generates postgresql URL from DB Account struct
func GetErrorResponse ¶
func GetErrorResponse(message string, statusCode int, code string) *resources.ApplicationError
GetErrorResponse is a function for build errorMessage
func GetUniqueElementsSliceOfString ¶
GetUniqueElementsSliceOfString gets unique element of a slice of string
func RespondWithError ¶
RespondWithError for sending response with status not 200
func ResponseJSON ¶
ResponseJSON for sending response with status 200
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.