Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminHandler ¶
type AdminHandler struct {
// contains filtered or unexported fields
}
AdminHandler manages api endpoints for admins
func NewAdminHandler ¶
func NewAdminHandler(db *gorm.DB) *AdminHandler
NewAdminHandler creates a new instance
func (AdminHandler) Login ¶
func (handler AdminHandler) Login(c *gin.Context)
Login attempts to log an admin in
type CommentHandler ¶
type CommentHandler struct {
// contains filtered or unexported fields
}
CommentHandler manages api endpoints for comments
func NewCommentHandler ¶
func NewCommentHandler(db *gorm.DB) *CommentHandler
NewCommentHandler creates a new instance
func (CommentHandler) CreateComment ¶
func (handler CommentHandler) CreateComment(c *gin.Context)
CreateComment creates a new comment on a post
type ExportHandler ¶
type ExportHandler struct {
// contains filtered or unexported fields
}
ExportHandler manages api endpoints for exporting reports
func NewExportHandler ¶
func NewExportHandler(db *gorm.DB) *ExportHandler
NewExportHandler creates a new instance
func (ExportHandler) GetAllQuestionsCSV ¶
func (handler ExportHandler) GetAllQuestionsCSV(c *gin.Context)
GetAllQuestionsCSV serves a csv file report of all the questions in a group Columns: Question, Score (upvotes - downvotes), Total votes (upvotes + downvotes), Upvotes, Downvotes, Created by
func (ExportHandler) GetTopUsersCSV ¶
func (handler ExportHandler) GetTopUsersCSV(c *gin.Context)
GetTopUsersCSV serves a csv file report of users with the most votes Columns: Name, Total votes
type GroupHandler ¶
type GroupHandler struct {
// contains filtered or unexported fields
}
GroupHandler manges api endpoints for groups
func NewGroupHandler ¶
func NewGroupHandler(db *gorm.DB) *GroupHandler
NewGroupHandler creates a new instance
func (GroupHandler) GetOrCreateGroup ¶
func (handler GroupHandler) GetOrCreateGroup(c *gin.Context)
GetOrCreateGroup returns a group with the provided name, and creates one if it doesn't already exist
type PostHandler ¶
type PostHandler struct {
// contains filtered or unexported fields
}
PostHandler manages api endpoints for posts (questions)
func NewPostHandler ¶
func NewPostHandler(db *gorm.DB) *PostHandler
NewPostHandler creates a new instance
func (PostHandler) CreatePost ¶
func (handler PostHandler) CreatePost(c *gin.Context)
CreatePost creates a new question
func (PostHandler) DeletePost ¶
func (handler PostHandler) DeletePost(c *gin.Context)
DeletePost soft deletes a question
func (PostHandler) GetAllPostsForGroup ¶
func (handler PostHandler) GetAllPostsForGroup(c *gin.Context)
GetAllPostsForGroup returns all the questions in a group with nested data for their comments on the users on those comments
type UserHandler ¶
type UserHandler struct {
// contains filtered or unexported fields
}
UserHandler manages api endpoints for users
func NewUserHandler ¶
func NewUserHandler(db *gorm.DB) *UserHandler
NewUserHandler creates a new instance
func (UserHandler) LoginWithClientID ¶
func (handler UserHandler) LoginWithClientID(c *gin.Context)
LoginWithClientID logs a user in using the data from the client, which gives them permission to post a question, comment, and vote in a group
func (UserHandler) Logout ¶
func (handler UserHandler) Logout(c *gin.Context)
Logout logs a user out
type VoteHandler ¶
type VoteHandler struct {
// contains filtered or unexported fields
}
VoteHandler manages api endpoints for voting
func NewVoteHandler ¶
func NewVoteHandler(db *gorm.DB) *VoteHandler
NewVoteHandler creates a new instance
func (VoteHandler) CreateOrUpdateVote ¶
func (handler VoteHandler) CreateOrUpdateVote(c *gin.Context)
CreateOrUpdateVote create a new vote or update the user's existing one
func (VoteHandler) GetUserVotes ¶
func (handler VoteHandler) GetUserVotes(c *gin.Context)
GetUserVotes gets the user's votes for a group