{"modulePath":"github.com/CodeChefVIT/devsoc-be-24","version":"v0.0.0-20250211013910-23e82010c53a","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Variables\n\n```go\nvar Config cfg\n```\n\n```go\nvar Queries *db.Queries\n```\n\n```go\nvar RedisClient *redis.Client\n```\n\n```go\nvar Validate *validator.Validate\n```\n\n## Functions\n\n```go\nfunc FormatValidationErrors(err error) string\n```\n\n```go\nfunc GenerateOTP(ctx context.Context, email string) error\n```\n\n```go\nfunc GenerateRandomString(length int) string\n```\n\n```go\nfunc GenerateToken(userId *uuid.UUID, isRefresh bool) (string, error)\n```\n\n```go\nfunc InitCache()\n```\n\n```go\nfunc InitDB()\n```\n\n```go\nfunc InitMailer()\n```\n\n```go\nfunc InitValidator()\n```\n\n```go\nfunc Ping(pool *pgxpool.Pool)\n```\n\n```go\nfunc SendEmail(to, subject, body string, attachments ...string) error\n```\n\n```go\nfunc SendTeamEmail(ctx context.Context, emails []string) error\n```\n\n```go\nfunc ValidateAlphaNum(str string) bool\n```\n\n```go\nfunc WriteError(c echo.Context, status int, err error) error\n```\n\n```go\nfunc WriteJSON(c echo.Context, status int, message interface{}) error\n```\n\n## Types\n\n```go\ntype JWTClaims struct {\n\tUserID uuid.UUID `json:\"user_id\"`\n\tjwt.RegisteredClaims\n}\n```\n\n```go\nfunc ValidateRefreshToken(tokenString string) (*JWTClaims, error)\n```\n\n```go\ntype StandardResponse struct {\n\tStatus  int         `json:\"status\"`\n\tMessage interface{} `json:\"message,omitempty\"`\n\tError   string      `json:\"error,omitempty\"`\n}\n```\n\n","path":"github.com/CodeChefVIT/devsoc-be-24/pkg/utils","name":"utils","synopsis":"","isRedistributable":true}
