Documentation ¶
Index ¶
- func AuthRequired() gin.HandlerFunc
- func AutoMigrateDB(db *gorm.DB)
- func Backup() error
- func CurrentTime() string
- func DbConnect() (*gorm.DB, error)
- func ExitApp(code int)
- func ExtractAppName(c *gin.Context) (appName string)
- func GenerateUUID() string
- func InitLogger() error
- func Log(msg ...interface{})
- func LogError(msg ...interface{})
- func LogInfo(msg ...interface{})
- func LogWarning(msg ...interface{})
- func MetricsMonitor() gin.HandlerFunc
- func RedisConnect() (client *redis.Client)
- func RespondWithError(w http.ResponseWriter, code int, msg string)
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- func SeedDB(db *gorm.DB)
- func SendError(c *gin.Context, msg string)
- func SendGet(url string) (result map[string]interface{}, err error)
- func SendJson(c *gin.Context, payload gin.H)
- func SendMail(from, toName, to, subject, body string) (ok bool, err error)
- func ValidateEmail(email string) (bool, error)
- func VerifyToken(tokenString string) (*jwt.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthRequired ¶
func AuthRequired() gin.HandlerFunc
func AutoMigrateDB ¶
Create tables in the database and run migrations of models change
func CurrentTime ¶
func CurrentTime() string
func DbConnect ¶
Returns a connection to db or error Connects to DB depending on the APP_ENV, by using APP_ENV value as a prefix to db credentials i.e, if APP_ENV=prod, it will connect to the production db, same for local, dev, staging APP_ENV=local, it will connect to localhost db APP_ENV=dev, it will connect to shared dev db APP_ENV=staging, it will connect to the staging db
func ExtractAppName ¶
func GenerateUUID ¶
func GenerateUUID() string
func InitLogger ¶
func InitLogger() error
func LogWarning ¶
func LogWarning(msg ...interface{})
func MetricsMonitor ¶
func MetricsMonitor() gin.HandlerFunc
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, msg string)
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
func ValidateEmail ¶
func VerifyToken ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.