Documentation ¶
Index ¶
- func DeletePostById(id int) error
- func DeleteUserByUsername(username string) error
- func ExistsPostById(id int) bool
- func ExistsUserByUsername(username string) bool
- func ExistsUserByUsernameOrNicknameOrEmail(username, nickname, email string) bool
- func GetNextId(doc string) int
- type Comment
- type Post
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeletePostById ¶
func DeleteUserByUsername ¶
func ExistsPostById ¶
func ExistsUserByUsername ¶
Types ¶
type Comment ¶
type Comment struct { Id int `json:"id" bson:"_id"` Content string `json:"content"` Writer bson.ObjectId `json:"writer"` CreateAt time.Time `json:"create_at"` UpdateAt time.Time `json:"update_at"` }
func NewComment ¶
type Post ¶
type Post struct { Id int `json:"id" bson:"_id"` Title string `json:"title"` Content string `json:"content"` Writer bson.ObjectId `json:"writer"` Comments []Comment `json:"comments"` CreateAt time.Time `json:"create_at"` UpdateAt time.Time `json:"update_at"` }
func FindPostById ¶
func (*Post) AddComment ¶
Click to show internal directories.
Click to hide internal directories.