Documentation
¶
Index ¶
- type CommentsHandler
- type CountCommentsRequest
- type CountCommentsResponse
- type CreateCommentRequest
- type CreateCommentResponse
- type CreateLikeRequest
- type CreateLikeResponse
- type CreatePostRequest
- type CreatePostResponse
- type DeleteCommentRequest
- type DeleteCommentResponse
- type DeleteLikeRequest
- type DeleteLikeResponse
- type DeletePostRequest
- type DeletePostResponse
- type GetCurrentUserResponse
- type GetPostRequest
- type GetPostResponse
- type GetUserRequest
- type GetUserResponse
- type LikesHandler
- type ListCommentsRequest
- type ListCommentsResponse
- type ListLikesRequest
- type ListLikesResponse
- type ListPostsRequest
- type ListPostsResponse
- type PostsHandler
- type SigninRequest
- type SigninResponse
- type SignupRequest
- type SignupResponse
- type User
- type UsersHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentsHandler ¶
type CommentsHandler struct {
// contains filtered or unexported fields
}
func NewCommentsHandler ¶
func NewCommentsHandler(db datastore.Database) CommentsHandler
func (CommentsHandler) Count ¶
func (ch CommentsHandler) Count(c *gin.Context)
func (CommentsHandler) Create ¶
func (ch CommentsHandler) Create(c *gin.Context)
func (CommentsHandler) Delete ¶
func (ch CommentsHandler) Delete(c *gin.Context)
func (CommentsHandler) List ¶
func (ch CommentsHandler) List(c *gin.Context)
type CountCommentsRequest ¶
type CountCommentsRequest struct {
PostID string `uri:"post_id" binding:"required,uuid"`
}
type CountCommentsResponse ¶
type CountCommentsResponse struct {
Count uint64 `json:"count"`
}
type CreateCommentRequest ¶
type CreateCommentRequest struct { // UserID string `json:"user_id" binding:"required,uuid"` // PostID string `uri:"post_id" binding:"required,uuid"` // Text string `json:"text" binding:"required"` PostID struct { PostID string `uri:"post_id" json:"post_id" binding:"required,uuid"` } Text struct { Text string `json:"text" binding:"required"` } }
Comments
type CreateCommentResponse ¶
type CreateCommentResponse struct { }
type CreateLikeRequest ¶
type CreateLikeRequest struct { // UserID string `json:"user_id" binding:"required,uuid"` PostID string `uri:"post_id" binding:"required,uuid"` }
Likes
type CreateLikeResponse ¶
type CreateLikeResponse struct { }
type CreatePostRequest ¶
type CreatePostResponse ¶
type CreatePostResponse struct { }
type DeleteCommentRequest ¶
type DeleteCommentRequest struct {
ID string `uri:"id" binding:"required,uuid"`
}
type DeleteCommentResponse ¶
type DeleteCommentResponse struct { }
type DeleteLikeRequest ¶
type DeleteLikeRequest struct {
PostID string `uri:"post_id" binding:"required,uuid"`
}
type DeleteLikeResponse ¶
type DeleteLikeResponse struct { }
type DeletePostRequest ¶
type DeletePostRequest struct {
PostID string `uri:"id" binding:"required,uuid"`
}
type DeletePostResponse ¶
type DeletePostResponse struct { }
type GetCurrentUserResponse ¶
type GetCurrentUserResponse struct {
User
}
type GetPostRequest ¶
type GetPostRequest struct {
PostID string `uri:"id" binding:"required,uuid"`
}
type GetPostResponse ¶
type GetUserRequest ¶
type GetUserRequest struct {
ID string `uri:"id" binding:"required,uuid"`
}
type GetUserResponse ¶
type LikesHandler ¶
type LikesHandler struct {
// contains filtered or unexported fields
}
func NewLikesHandler ¶
func NewLikesHandler(db datastore.Database) LikesHandler
func (LikesHandler) Create ¶
func (lh LikesHandler) Create(c *gin.Context)
func (LikesHandler) Delete ¶
func (lh LikesHandler) Delete(c *gin.Context)
func (LikesHandler) List ¶
func (lh LikesHandler) List(c *gin.Context)
type ListCommentsRequest ¶
type ListCommentsRequest struct {
PostID string `uri:"post_id" binding:"required,uuid"`
}
type ListCommentsResponse ¶
type ListLikesRequest ¶
type ListLikesRequest struct {
PostID string `uri:"post_id" binding:"required,uuid"`
}
type ListLikesResponse ¶
type ListLikesResponse struct {
Likes uint64 `json:"likes"`
}
type ListPostsResponse ¶
type PostsHandler ¶
type PostsHandler struct {
// contains filtered or unexported fields
}
func NewPostsHandler ¶
func NewPostsHandler(db datastore.Database) PostsHandler
func (PostsHandler) Create ¶
func (ph PostsHandler) Create(c *gin.Context)
func (PostsHandler) Delete ¶
func (ph PostsHandler) Delete(c *gin.Context)
func (PostsHandler) Get ¶
func (ph PostsHandler) Get(c *gin.Context)
func (PostsHandler) List ¶
func (ph PostsHandler) List(c *gin.Context)
type SigninRequest ¶
type SigninResponse ¶
type SignupRequest ¶
type SignupRequest struct { Firstname string `json:"firstname" binding:"required"` Lastname string `json:"lastname" binding:"required"` Username string `json:"username" binding:"required"` Email string `json:"email" binding:"required,email"` Password string `json:"password" binding:"required"` }
Users
type SignupResponse ¶
type SignupResponse struct {
JWT string `json:"jwt"`
}
type UsersHandler ¶
type UsersHandler struct {
// contains filtered or unexported fields
}
func NewUsersHandler ¶
func NewUsersHandler(db datastore.Database) UsersHandler
func (UsersHandler) GetCurrentUser ¶
func (uh UsersHandler) GetCurrentUser(c *gin.Context)
func (UsersHandler) GetUser ¶
func (uh UsersHandler) GetUser(c *gin.Context)
func (UsersHandler) Signin ¶
func (uh UsersHandler) Signin(c *gin.Context)
func (UsersHandler) Signup ¶
func (rh UsersHandler) Signup(c *gin.Context)
Click to show internal directories.
Click to hide internal directories.