Documentation ¶
Index ¶
- func CheckPassword(password, hashedPassword string) error
- func ErrorResponse(err error) gin.H
- func GenLink(frontend string, groupID string, inviterID string) string
- func HashPassword(password string) (string, error)
- func MigrateDB(config Config) error
- func NullInt64(i int64) sql.NullInt64
- func NullString(s string) sql.NullString
- func RandomEmail() string
- func RandomInt(min, max int64) int64
- func RandomName() string
- func RandomString(n int) string
- func ResponseWithMessage(message string) gin.H
- func StringFromNull(n sql.NullString) string
- func SuccessResponse() gin.H
- type Config
- type JwtWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
func ErrorResponse ¶
func HashPassword ¶
func NullString ¶
func NullString(s string) sql.NullString
func RandomEmail ¶
func RandomEmail() string
func RandomName ¶
func RandomName() string
func RandomString ¶
func ResponseWithMessage ¶
func StringFromNull ¶
func StringFromNull(n sql.NullString) string
func SuccessResponse ¶
Types ¶
type Config ¶
type Config struct { Env string `mapstructure:"ENV"` DBDriver string `mapstructure:"DB_DRIVER"` DBUrl string `mapstructure:"DATABASE_URL"` Host string `mapstructure:"HOST"` Port int `mapstructure:"PORT"` ServerAddress string `mapstructure:"SERVER_ADDRESS"` FrontendAddress string `mapstructure:"FRONTEND_ADDRESS"` JwtSecretKey string `mapstructure:"JWT_SECRET_KEY"` AccessTokenExpiredTime int32 `mapstructure:"ACCESS_TOKEN_EXPIRED_TIME"` RefreshTokenExpiredTime int32 `mapstructure:"REFRESH_TOKEN_EXPIRED_TIME"` FBKey string `mapstructure:"FB_KEY"` FBSecret string `mapstructure:"FB_SECRET"` GGKey string `mapstructure:"GLE_KEY"` GGSecret string `mapstructure:"GLE_SECRET"` SendgridApiKey string `mapstructure:"SENDGRID_API_KEY"` SendgridEmail string `mapstructure:"SENDGRID_EMAIL"` CloudinaryUrl string `mapstructure:"CLOUDINARY_URL"` CloudinaryUploadFolder string `mapstructure:"CLOUDINARY_UPLOAD_FOLDER"` }
func LoadConfig ¶
type JwtWrapper ¶
func (*JwtWrapper) GenerateToken ¶
func (*JwtWrapper) ValidateToken ¶
func (w *JwtWrapper) ValidateToken(signedToken string) (claims *jwtClaims, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.