Documentation ¶
Index ¶
- type BlogPost
- type BlogPostCreateRequest
- type BlogPostCreateResponse
- type BlogPostPagination
- type BlogPostQueryParams
- type BlogPostUpdateRequest
- type BlogPostUpdateResponse
- type Comment
- type CommentCreateRequest
- type CommentCreateResponse
- type CommentPagination
- type CommentQueryParams
- type CommentUpdateRequest
- type CommentUpdateResponse
- type FollowerCreateRequest
- type JWTToken
- type LoginRequest
- type LoginResponse
- type MePasswordRequest
- type MeResponse
- type MeUpdateRequest
- type OrderFilter
- type Pagination
- type PaginationParams
- type PostInComment
- type RegisterRequest
- type RegisterResponse
- type SearchFilter
- type UnFollowerCreateRequest
- type User
- type UserInBlogPost
- type UserInComment
- type UserInFollower
- type UserPagination
- type UserQueryParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlogPost ¶
type BlogPost struct { ID uint `json:"id"` Title string `json:"title"` Body string `json:"body"` User *UserInBlogPost `json:"user"` }
type BlogPostCreateRequest ¶
type BlogPostCreateResponse ¶
type BlogPostPagination ¶
type BlogPostPagination struct { List []*BlogPost `json:"list"` Pagination *Pagination `json:"pagination"` }
type BlogPostQueryParams ¶
type BlogPostQueryParams struct { SearchFilter OrderFilter PaginationParams }
func (BlogPostQueryParams) DefaultPageSize ¶
func (q BlogPostQueryParams) DefaultPageSize() int
func (BlogPostQueryParams) OrderFields ¶
func (q BlogPostQueryParams) OrderFields() []string
func (BlogPostQueryParams) SearchFields ¶
func (q BlogPostQueryParams) SearchFields() []string
type BlogPostUpdateRequest ¶
type BlogPostUpdateResponse ¶
type Comment ¶
type Comment struct { ID uint `json:"id"` Body string `json:"body"` User *UserInComment `json:"user"` Post *PostInComment `json:"post"` }
type CommentCreateRequest ¶
type CommentCreateResponse ¶
type CommentPagination ¶
type CommentPagination struct { List []*Comment `json:"list"` Pagination *Pagination `json:"pagination"` }
type CommentQueryParams ¶
type CommentQueryParams struct { SearchFilter OrderFilter PaginationParams }
func (CommentQueryParams) DefaultPageSize ¶
func (q CommentQueryParams) DefaultPageSize() int
func (CommentQueryParams) OrderFields ¶
func (q CommentQueryParams) OrderFields() []string
func (CommentQueryParams) SearchFields ¶
func (q CommentQueryParams) SearchFields() []string
type CommentUpdateRequest ¶
type CommentUpdateRequest struct {
Body string `json:"body" validate:"min=10,max=500"`
}
type CommentUpdateResponse ¶
type FollowerCreateRequest ¶
type FollowerCreateRequest struct {
UserID uint `json:"user_id" validate:"required"`
}
type LoginRequest ¶
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
type MePasswordRequest ¶
type MePasswordRequest struct { OldPassword string `json:"old_password" validate:"required,min=8,max=20"` NewPassword string `json:"new_password" validate:"required,min=8,max=20"` ConfirmPassword string `json:"confirm_password" validate:"required,min=8,max=20"` }
func (MePasswordRequest) PasswordMatches ¶
func (d MePasswordRequest) PasswordMatches() bool
type MeResponse ¶
type MeUpdateRequest ¶
type MeUpdateRequest struct {
Name string `json:"name"`
}
type OrderFilter ¶
type OrderFilter struct {
OrderBy string `json:"order_by" query:"order_by"`
}
func (OrderFilter) ParseOrderFilter ¶
func (f OrderFilter) ParseOrderFilter(safeFilters []string) string
type Pagination ¶
type PaginationParams ¶
type PaginationParams struct { Current int `json:"current" query:"current"` PageSize int `json:"page_size" query:"page_size"` }
func (*PaginationParams) SetDefaultPageSize ¶
func (p *PaginationParams) SetDefaultPageSize(pageSize int)
type PostInComment ¶
type RegisterRequest ¶
type RegisterResponse ¶
type SearchFilter ¶
type SearchFilter struct {
Q string `json:"q" query:"q"`
}
func (SearchFilter) GetSearch ¶
func (f SearchFilter) GetSearch(search []string) string
type UnFollowerCreateRequest ¶
type UnFollowerCreateRequest struct {
UserID uint `json:"user_id" validate:"required"`
}
type UserInBlogPost ¶
type UserInComment ¶
type UserInFollower ¶
type UserPagination ¶
type UserPagination struct { List []*User `json:"list"` Pagination *Pagination `json:"pagination"` }
type UserQueryParams ¶
type UserQueryParams struct { SearchFilter OrderFilter PaginationParams }
func (UserQueryParams) DefaultPageSize ¶
func (q UserQueryParams) DefaultPageSize() int
func (UserQueryParams) OrderFields ¶
func (q UserQueryParams) OrderFields() []string
func (UserQueryParams) SearchFields ¶
func (q UserQueryParams) SearchFields() []string
Click to show internal directories.
Click to hide internal directories.