Documentation ¶
Index ¶
- func GenerateAccessToken(email string, id primitive.ObjectID, role string) (string, error)
- func GenerateIDs(length int) string
- func GenerateRefreshToken(email string, id primitive.ObjectID, v int) (string, error)
- func HandleRequestErrors()
- func IsTimeBetween(Time time.Time, timeStart float32, timeEnd float32) bool
- func VerifyPassword(password, hashedPassword string) error
- type AcessTokenClaim
- type ErrorResonse
- type ErrorResponse
- type RefereshTokenClaim
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAccessToken ¶
func GenerateIDs ¶
func GenerateRefreshToken ¶
func HandleRequestErrors ¶
func HandleRequestErrors()
func VerifyPassword ¶
Types ¶
type AcessTokenClaim ¶
type AcessTokenClaim struct { jwt.StandardClaims Id string `json:"id"` Email string `json:"email"` Role string `json:"role"` }
func VerifyAccessToken ¶
func VerifyAccessToken(tokenString string) (AcessTokenClaim, error)
type ErrorResonse ¶
func UploadFiles ¶
func UploadFiles(base string, files ...*multipart.FileHeader) ([]string, *ErrorResonse)
type ErrorResponse ¶
type ErrorResponse struct { Status int Message interface{} }
func HandlerError ¶
func HandlerError(err error) ErrorResponse
type RefereshTokenClaim ¶
type RefereshTokenClaim struct { jwt.StandardClaims Id string `json:"id"` Email string `json:"email"` TokenVersion int `json:"token_v"` }
func VerifyRefereshToken ¶
func VerifyRefereshToken(tokenString string) (*RefereshTokenClaim, error)
Click to show internal directories.
Click to hide internal directories.