Documentation ¶
Index ¶
- func CommentCount(postID primitive.ObjectID) (int64, error)
- func Delete(id primitive.ObjectID) error
- func DeleteByPost(postID primitive.ObjectID) error
- func ReplyCount(parentID primitive.ObjectID) (int64, error)
- type Comment
- func FindAll(filter bson.M) ([]Comment, error)
- func RetrieveAll(postID primitive.ObjectID, parentID primitive.ObjectID, ...) ([]Comment, error)
- func RetrieveDefault(postID primitive.ObjectID, iteration int) ([]Comment, error)
- func RetrieveUserComments(userID primitive.ObjectID, postID primitive.ObjectID) ([]Comment, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteByPost ¶
Types ¶
type Comment ¶
type Comment struct { ID primitive.ObjectID `json:"id" bson:"_id,omitempty"` PostID primitive.ObjectID `json:"post_id" bson:"post_id,required"` UserID primitive.ObjectID `json:"user_id" bson:"user_id,required"` Content string `json:"content" bson:"content,required"` Parent primitive.ObjectID `json:"parent" bson:"parent,required"` CreatedAt time.Time `json:"created_at" bson:"created_at,required"` }
func RetrieveAll ¶
func RetrieveDefault ¶
func RetrieveUserComments ¶
Click to show internal directories.
Click to hide internal directories.