Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertOrderEnumToMongoInt(dir string) int
- func ErrorLog(format string, v ...interface{})
- func ErrorResponse(c *gin.Context, msg string, err error, req string)
- func GetSearchBuilderBson(sb *models.SearchBuilderRequest) bson.M
- func InfoLogV0(format string, v ...interface{})
- func InfoLogV1(format string, v ...interface{})
- func InfoLogV2(format string, v ...interface{})
- func MiddlewareReqHandler() gin.HandlerFunc
- type ErrorResponseStruct
Constants ¶
View Source
const ( KB float64 = 1e3 MB float64 = 1e6 GB float64 = 1e9 TB float64 = 1e12 PB float64 = 1e15 EB float64 = 1e18 )
KB to EB bytes definition, uses x1000
Variables ¶
View Source
var Verbose int
Verbose defines verbosity, user given parameter, default 0: INFO logs
Functions ¶
func ConvertOrderEnumToMongoInt ¶
ConvertOrderEnumToMongoInt converts DataTable enums ("asc" and "desc") to Mongo sorting integer definitions (1,-1)
func ErrorLog ¶
func ErrorLog(format string, v ...interface{})
ErrorLog prints error logs, but not exit the process like log.Fatal
func ErrorResponse ¶
ErrorResponse returns error response with given msg and error
func GetSearchBuilderBson ¶
func GetSearchBuilderBson(sb *models.SearchBuilderRequest) bson.M
GetSearchBuilderBson iterates over all criteria(s) and creates "AND"/"OR" bson.M query
func InfoLogV0 ¶
func InfoLogV0(format string, v ...interface{})
InfoLogV0 prints logs with verbosity >= 0
func InfoLogV1 ¶
func InfoLogV1(format string, v ...interface{})
InfoLogV1 prints logs with verbosity >= 1
func InfoLogV2 ¶
func InfoLogV2(format string, v ...interface{})
InfoLogV2 prints logs with verbosity >= 2
func MiddlewareReqHandler ¶
func MiddlewareReqHandler() gin.HandlerFunc
MiddlewareReqHandler handles CORS and HTTP request settings for the context router
Types ¶
Click to show internal directories.
Click to hide internal directories.