Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HashID *hashids.HashID
Functions ¶
func CreateComment ¶
Types ¶
type CategoryWithNum ¶
type HistoryEducation ¶
type HistoryEducation struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time Course string City string Description string FromTo string Sort int }
func GetAllHistoryEducations ¶
func GetAllHistoryEducations() []HistoryEducation
type HistoryWork ¶
type HistoryWork struct { ID uint `gorm:"primaryKey"` CreatedAt time.Time UpdatedAt time.Time Company string JobTitle string Description string FromTo string Sort int }
func GetAllHistoryWorks ¶
func GetAllHistoryWorks() []HistoryWork
type Post ¶
type Post struct { ID int Title string Summary string Body string VisitCount int CreatedAt time.Time Comments []Comment CommentCount int64 `gorm:"-:all"` // ignore CommentCount field when write, read and migrate with struct }
func (Post) DeleteCacheCommentCount ¶
func (post Post) DeleteCacheCommentCount()
delete post's comment count value from redis
func (*Post) GetAllComments ¶
func (Post) GetCommentCount ¶
get post's comment count from redis or query database and cache it
Source Files ¶
Click to show internal directories.
Click to hide internal directories.