Documentation
¶
Index ¶
- func CloseDB()
- func DeleteCommentID(id int) error
- func DeletePost(post int) error
- func DeleteUser(user int) error
- func InitDB(dbfile, initfile string) error
- func QueryNextPost(post int) (int, error)
- func QueryPrevPost(post int) (int, error)
- func QueryUserExists(name string) (bool, error)
- func UpdatePost(p SQLPost) error
- func UpdateUser(user SQLUser) error
- func WriteComment(c SQLComment) error
- func WriteCommentReply(c SQLComment) error
- func WritePost(p SQLPost) error
- func WriteUser(user SQLUser) error
- type SQLComment
- type SQLPost
- type SQLUser
- type Siteconf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCommentID ¶
func DeletePost ¶
func DeleteUser ¶
func QueryNextPost ¶
func QueryPrevPost ¶
func QueryUserExists ¶
func UpdatePost ¶
func UpdateUser ¶
func WriteComment ¶
func WriteComment(c SQLComment) error
func WriteCommentReply ¶
func WriteCommentReply(c SQLComment) error
Types ¶
type SQLComment ¶
type SQLComment struct {
Commentid int64
Postid int
Parentid sql.NullInt64
Userid int
Body string
Posted int64
Updated int64
// Not in SQL below this comment
Separator string
Indent int
Username string
Nicetime string
}
func QueryCommentID ¶
func QueryCommentID(id int) (SQLComment, error)
func QueryCommentsPost ¶
func QueryCommentsPost(post int) ([]SQLComment, error)
type SQLPost ¶
type SQLPost struct {
Postid int
Userid int
Title string
Body string
BodyHTML string
RenderHTML template.HTML
Categoryid int
Posted int64
Updated int64
// Not in SQL below this line
Username string
PostedNice string
UpdatedNice string
}
func ProcessPosts ¶
ProcessPosts adds the following dynamic information to a slice of SQLPost objects: the username that posted them and the 'nice time' of their post and last updated date.
func QueryPostsPage ¶
QueryPostsPage returns posts in page page, of size size.
func QueryPostsUserID ¶
Click to show internal directories.
Click to hide internal directories.