Documentation
¶
Index ¶
- func GenerateJWTToken(user *models.User, config *config.Config) (string, error)
- func GetIPAddress(c echo.Context) string
- func GetRequestCtx(c echo.Context) context.Context
- func GetRequestID(c echo.Context) string
- func LogResponseError(ctx echo.Context, err error)
- func ReadRequest(ctx echo.Context, request interface{}) error
- func ValidateStruct(ctx context.Context, s interface{}) error
- type Claims
- type ReqIDCtxKey
- type UserCtxKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateJWTToken ¶
func LogResponseError ¶
Error response with logging error for echo context
func ReadRequest ¶
Read request body and validate
func ValidateStruct ¶
Validate struct fields
Types ¶
type Claims ¶
type Claims struct {
Email string `json:"email"`
ID string `json:"id"`
jwt.RegisteredClaims
}
JWT Claims struct
type ReqIDCtxKey ¶
type ReqIDCtxKey struct{}
ReqIDCtxKey is a key used for the Request ID in context
type UserCtxKey ¶
type UserCtxKey struct{}
UserCtxKey is a key used for the User object in the context
Click to show internal directories.
Click to hide internal directories.