Documentation ¶
Index ¶
- func AnswerPost(w http.ResponseWriter, r *http.Request)
- func Forum(w http.ResponseWriter, r *http.Request)
- func InsertNewAnswer(db *sql.DB, username, text, topic string) error
- func InsertNewTopic(w http.ResponseWriter, r *http.Request)
- func InsertNewTopicInDB(db *sql.DB, username, title, text string) (string, error)
- func NewForumTopic(w http.ResponseWriter, r *http.Request)
- func PostPage(w http.ResponseWriter, r *http.Request)
- type FPost
- type Page
- type Post
- type PostPageData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnswerPost ¶
func AnswerPost(w http.ResponseWriter, r *http.Request)
AnswerPost parses and inserts the data for a new forum topic answer.
func Forum ¶
func Forum(w http.ResponseWriter, r *http.Request)
Forum endpoint returns the forum index.
func InsertNewAnswer ¶
InsertNewAnswer inserts a new forum post as an answer to the forum topic associated with the topic by the topic slug into the database.
func InsertNewTopic ¶
func InsertNewTopic(w http.ResponseWriter, r *http.Request)
InsertNewTopic endpoint parses the form data and inserts a new forum topic with an associated post.
func InsertNewTopicInDB ¶
InsertNewTopicInDB inserts a new forum topic and the associated forum post into the database.
func NewForumTopic ¶
func NewForumTopic(w http.ResponseWriter, r *http.Request)
NewForumTopic returns the HTML page we use to create a forum topic.
Types ¶
type FPost ¶
FPost contains the data for a single Forum post.
func GetForumPosts ¶
GetForumPosts returns forum topics with all forum posts by the forum topic slug from the database.
type Page ¶
Page is a generic struct for a general HTML page. Only contains the necessary data to render the page.