Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEmail ¶
CreateEmail puts email address into a database
Types ¶
type Comment ¶
type Comment struct { ID bson.ObjectId `json:"id" bson:"_id"` PostID bson.ObjectId `json:"post_id" bson:"post_id"` Content string `json:"content" bson:"content" schema:"message"` Author string `json:"author" bson:"author" schema:"username"` Email string `json:"email" bson:"email" schema:"email"` Website string `json:"website" bson:"website" schema:"website"` CreatedAt string `json:"time" bson:"time"` ApprovedFlg int `json:"approved_flg" bson:"approved_flg"` //pending or approved. Pending by default. }
Comment Struct
type Email ¶
type Email struct { ID bson.ObjectId `json:"id" bson:"_id"` EmailAddress string `json:"email" bson:"email"` }
Email Struct
type Post ¶
type Post struct { ID bson.ObjectId `json:"id" bson:"_id"` IDstr string `json:"idstr" bson:"idstr,omitempty"` Name string `json:"name" bson:"name"` Category string `json:"category" bson:"category"` CategoryEng string `json:"categoryeng" bson:"categoryeng"` Date string `json:"date" bson:"date"` Images []string `json:"images" bson:"images"` Author string `json:"author" bson:"author"` Content []string `json:"content" bson:"content"` Likes int `json:"likes" bson:"likes"` Comments []Comment `json:"comments" bson:"comments"` CommentCnt int `json:"comments_cnt" bson:"comments_cnt"` IsPopular int `json:"popular" bson:"popular"` NextPostID bson.ObjectId `json:"next_id" bson:"next_post_id,omitempty"` NextPostIDstr string `json:"next_idstr" bson:"next_post_idstr,omitempty"` PrevPostID bson.ObjectId `json:"prev_id" bson:"prev_post_id,omitempty"` PrevPostIDstr string `json:"prev_idstr" bson:"prev_post_idstr,omitempty"` }
Post Struct
func CreateComment ¶
CreateComment puts a comment to a post into a database
func PostsByCategory ¶
PostsByCategory retrieves posts by category
Click to show internal directories.
Click to hide internal directories.