Documentation ¶
Index ¶
- Constants
- func PasswordValidation(pass interface{}) error
- type Comment
- type Email
- type Follow
- type Like
- type PostingId
- type RequestLogin
- type RequestRegisterPosting
- type RequestRegisterUser
- type RequestResetPassword
- type RequestUpdateUser
- type ResponseBadRequest
- type ResponseForbidden
- type ResponseGetComment
- type ResponseGetComments
- type ResponseGetNotification
- type ResponseGetNotifications
- type ResponseGetPosting
- type ResponseGetPostings
- type ResponseGetUser
- type ResponseInternalServerError
- type ResponseNotAllowedMethod
- type ResponseNotFound
- type ResponseSimpleSuccess
- type ResponseUnauthorized
- type Token
Constants ¶
View Source
const ( MinPasswordLength = 6 MinVarcharLength = 2 MaxVarcharLength = 255 UUIDLength = 36 )
Variables ¶
This section is empty.
Functions ¶
func PasswordValidation ¶
func PasswordValidation(pass interface{}) error
custom password validation
upp: at least one upper case letter. low: at least one lower case letter. num: at least one digit. tot: at least eight characters long. No empty string or whitespace.
Types ¶
type Comment ¶
type Comment struct { // posting id PostingId int64 `json:"posting_id"` // comment Comment string `json:"comment"` }
Comment - posting comment
func (*Comment) ValidateParam ¶
type Email ¶
type Email struct { // email Email string `json:"email"` }
func (*Email) ValidateParam ¶
type Follow ¶
type Follow struct { // followed user name FollowedUserName string `json:"followed_user_name"` }
Follow - follow
func (*Follow) ValidateParam ¶
type Like ¶
type Like struct { // posting id PostingId int64 `json:"posting_id"` }
Like - like
func (*Like) ValidateParam ¶
type PostingId ¶
type PostingId struct { // posting id PostingId int64 `json:"posting_id,omitempty"` }
type RequestLogin ¶
type RequestLogin struct { // email Email string `json:"email"` // password Password string `json:"password"` }
func (*RequestLogin) ValidateParam ¶
func (req *RequestLogin) ValidateParam() error
type RequestRegisterPosting ¶
type RequestRegisterPosting struct { // the title of posting Title string `json:"title"` // posting image file of base64 encoded and zipped Image string `json:"image"` }
func (*RequestRegisterPosting) ValidateParam ¶
func (req *RequestRegisterPosting) ValidateParam() error
type RequestRegisterUser ¶
type RequestRegisterUser struct { // email Email string `json:"email"` // user_name UserName string `json:"user_name"` // password Password string `json:"password"` }
func (*RequestRegisterUser) ValidateParam ¶
func (req *RequestRegisterUser) ValidateParam() error
type RequestResetPassword ¶
type RequestResetPassword struct { // user name UserName string `json:"user_name"` // password Password string `json:"password"` // hashed key for password reset PasswordResetKey string `json:"password_reset_key"` }
func (*RequestResetPassword) ValidateParam ¶
func (req *RequestResetPassword) ValidateParam() error
type RequestUpdateUser ¶
type ResponseBadRequest ¶
type ResponseBadRequest struct { // status Status int32 `json:"status"` // message Message string `json:"message"` }
ResponseBadRequest - Bad Reqeust
type ResponseForbidden ¶
type ResponseForbidden struct { // status Status int32 `json:"status"` // message Message string `json:"message"` }
ResponseForbidden - Forbidden
type ResponseGetComment ¶
type ResponseGetComment struct { // comment id CommentId int64 `json:"comment_id"` // user_name UserName string `json:"user_name"` // commented datetime with TZ. This means created_at in postings table. CommentedAt time.Time `json:"commented_at"` // the content of comment Comment string `json:"comment"` }
type ResponseGetComments ¶
type ResponseGetComments struct { // posting id PostingId int64 `json:"posting_id,omitempty"` // list of comment Comments []ResponseGetComment `json:"comments,omitempty"` }
ResponseGetComments - get comments
type ResponseGetNotification ¶
type ResponseGetNotification struct { // acting user name VisitorName string `json:"visitor_name"` // only when action is like or comment PostingId int64 `json:"posting_id,omitempty"` // only when action is comment CommentId int64 `json:"comment_id,omitempty"` // action type ActionType string `json:"action_type,omitempty"` // datetime with TZ CreatedAt time.Time `json:"created_at"` }
type ResponseGetNotifications ¶
type ResponseGetNotifications struct { // acted user name VisitedName string `json:"visited_name,omitempty"` // actions Actions []ResponseGetNotification `json:"actions,omitempty"` }
ResponseGetNotifications - get notifications
type ResponseGetPosting ¶
type ResponseGetPosting struct { // id PostingId int64 `json:"posting_id"` // user_name UserName string `json:"user_name"` // uploaded datetime with TZ. This means created_at in postings table. UploadedAt time.Time `json:"uploaded_at"` // the title of posting Title string `json:"title"` // image url ImageUrl string `json:"image_url,omitempty"` // the number of liked Liked int64 `json:"liked"` }
type ResponseGetPostings ¶
type ResponseGetPostings struct { // list of posting Postings []ResponseGetPosting `json:"postings,omitempty"` }
ResponseGetPostings - get postings
type ResponseGetUser ¶
type ResponseGetUser struct { // user name UserName string `json:"user_name"` // icon Icon string `json:"icon"` // the total count of posting PostingCount int64 `json:"posting_count"` // the total count of like LikeCount int64 `json:"like_count"` // the total count of liked LikedCount int64 `json:"liked_count"` // the datetime when the account is created CreatedAt time.Time `json:"created_at"` }
ResponseGetUser - get user
type ResponseInternalServerError ¶
type ResponseInternalServerError struct { // status Status int32 `json:"status"` // message Message string `json:"message"` }
ResponseInternalServerError - Internal Server Error
type ResponseNotAllowedMethod ¶
type ResponseNotAllowedMethod struct { // status Status int32 `json:"status"` // message Message string `json:"message"` }
ResponseNotAllowedMethod - Not Allowed Method
type ResponseNotFound ¶
type ResponseNotFound struct { // status Status int32 `json:"status"` // message Message string `json:"message"` }
ResponseNotFound - Not Found
type ResponseSimpleSuccess ¶
type ResponseSimpleSuccess struct { // status Status int32 `json:"status"` // message Message string `json:"message"` }
ResponseSimpleSuccess - Success
type ResponseUnauthorized ¶
ResponseUnauthorized - Unauthorized
Source Files ¶
- model_comment.go
- model_email.go
- model_follow.go
- model_like.go
- model_posting_id.go
- model_request_login.go
- model_request_register_posting.go
- model_request_register_user.go
- model_request_reset_password.go
- model_request_update_user.go
- model_response_bad_request.go
- model_response_forbidden.go
- model_response_get_comment.go
- model_response_get_comments.go
- model_response_get_notification.go
- model_response_get_notifications.go
- model_response_get_posting.go
- model_response_get_postings.go
- model_response_get_user.go
- model_response_internal_server_error.go
- model_response_not_allowed_method.go
- model_response_not_found.go
- model_response_simple_success.go
- model_response_unauthorized.go
- model_token.go
- validator.go
Click to show internal directories.
Click to hide internal directories.