Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddComment ¶
func SetupEngine ¶
SetupEngine sets up an XORM engine according to the database configuration and syncs the schema.
func UpdateUser ¶
Types ¶
type Comment ¶
type Comment struct { CommentID int64 `xorm:"pk autoincr"` PostID int64 `xorm:"notnull"` PosterID string `xorm:"notnull"` Poster *User `xorm:"-"` Text string `xorm:"notnull"` FormattedText template.HTML `xorm:"-"` CreatedUnix int64 `xorm:"created"` Created string `xorm:"-"` UpdatedUnix int64 `xorm:"updated"` }
func (*Comment) LoadCreated ¶
func (*Comment) LoadPoster ¶
type Course ¶
type Course struct { Code string `xorm:"pk varchar(64)"` Name string `xorm:"notnull text"` Visible bool `xorm:"notnull"` Locked bool `xorm:"notnull"` PostsCount int64 `xorm:"-"` Posts []Post `xorm:"-"` CreatedUnix int64 `xorm:"created"` Created string `xorm:"-"` UpdatedUnix int64 `xorm:"updated"` }
func GetCourses ¶
func GetCourses() (courses []Course)
func (*Course) LoadPostsCount ¶
type Post ¶
type Post struct { PostID int64 `xorm:"pk autoincr"` CourseCode string `xorm:"text notnull"` PosterID string `xorm:"notnull"` Poster *User `xorm:"-"` Locked bool `xorm:"notnull"` // Whether the comments are locked. Comments []Comment `xorm:"-"` CommentsCount int64 `xorm:"-"` Title string `xorm:"text notnull"` Text string `xorm:"text notnull"` CreatedUnix int64 `xorm:"created"` Created string `xorm:"-"` UpdatedUnix int64 `xorm:"updated"` }
func GetAllUserPosts ¶
func (*Post) LoadComments ¶
Click to show internal directories.
Click to hide internal directories.