Versions in this module Expand all Collapse all v1 v1.0.0 May 1, 2022 Changes in this version + const OauthStateKey + const RoleAuthor + const RoleGuest + var ErrAlreadyLikeBlog = errors.New("already liking this blog") + var ErrBlogNotFound = errors.New("blog is not found") + var ErrCommentNotFound = errors.New("comment is not found") + var ErrEmailExisted = errors.New("email is existed") + var ErrFailedParseBody = errors.New("parse body error") + var ErrForbiddenAccess = errors.New("forbidden access") + var ErrForbiddenDelete = errors.New("forbidden deleteing data") + var ErrForbiddenDeleteSelf = errors.New("forbidden delete account self, make sure the id is corrent") + var ErrForbiddenUpdate = errors.New("forbidden updating data") + var ErrInvalidExchange = errors.New("invalid exchange") + var ErrInvalidPassword = errors.New("invalid password") + var ErrInvalidRequest = errors.New("invalid request body") + var ErrInvalidToken = errors.New("invalid jwt token") + var ErrLikeNotFound = errors.New("like is not found") + var ErrMismatchLogin = errors.New("mismatch login, please use endpoint /api/v1/auth/google/login") + var ErrRedisKeyNotExisted = errors.New("keys not existed") + var ErrRoleNotExisted = errors.New("role not existed") + var ErrSignedToken = errors.New("failed sign a token %v") + var ErrTagNameExisted = errors.New("tag is existed") + var ErrTagNotFound = errors.New("tag is not found") + var ErrTokenExpire = errors.New("token already expired, please to relogin application") + var ErrTokenNotFound = errors.New("token not found") + var ErrTypeAssertion = errors.New("type assertion error") + var ErrUserNotFound = errors.New("users is not found") + var IsAllowedEmailInput *regexp.Regexp + var KeyJWTValidAccess = "ValidJWTAccess" + func GetValidRoleByID(roleID int) (string, error) + type AuthUserDetails struct + Email string + FullName string + Password string + RoleID int + RoleName string + UserID int + type BlogResponse struct + Body string + Comments []int + CreatedAt time.Time + CreatedBy string + Footer string + ID int + Likes []int + Slug string + Tags []int + Title string + UpdatedAt time.Time + UpdatedBy *string + UserID int + type CommentRequest struct + Comment string + UserID int + type CreateBlogRequest struct + Body string + Footer string + Slug string + Tags []int + Title string + UserID int + type CreateTagRequest struct + Name string + type CreateUserRequest struct + Email string + FullName string + Password string + type FilterBlogRequest struct + EndDate string + StartDate string + Tags []int + type GoogleOauthResponse struct + Email string + GivenName string + ID string + Locale string + Name string + Picture string + Time string + VerifiedEmail bool + type LikeRequest struct + Like int + UserID int + type LoginRequest struct + Email string + Password string + type Metadata struct + Links map[string]string + Order string + Page int + Size int + TotalData int + TotalPage int + type SuccessLoginResponse struct + AccessToken string + ExpiredAt time.Time + Role string + type UpdateBlogRequest struct + Body string + Footer string + Slug string + Title string + UserID int + type UpdateTagRequest struct + Name string + type UpdateUserRequest struct + Email string + FullName string + Password string + type ViewBlogResponse struct + Body string + Comments []sql.NullInt32 + CreatedAt time.Time + CreatedBy string + Footer string + ID int + Likes []sql.NullInt32 + Slug string + Tags []sql.NullInt32 + Title string + UpdatedAt time.Time + UpdatedBy *string + UserID int + type ViewCommentResponse struct + BlogID int + Comment string + CreatedAt time.Time + CreatedBy string + ID int + UpdatedAt time.Time + UpdatedBy *string + UserID int + type ViewLikeResponse struct + BlogID int + ID int + Like int + UserID int + type ViewTagResponse struct + CreatedAt time.Time + CreatedBy string + ID int + Name string + UpdatedAt time.Time + UpdatedBy *string + type ViewUserResponse struct + CreatedAt time.Time + CreatedBy string + Email string + FullName string + ID int + UpdatedAt time.Time + UpdatedBy *string