Documentation ¶
Index ¶
Constants ¶
const ( // GroupType is an enum for group chat GroupType = "Group" // ConferenceType is an enum for conference ConferenceType = "Conference" )
Variables ¶
This section is empty.
Functions ¶
func GetAll ¶
func GetAll(c *fiber.Ctx) error
GetAll is a function to get all groups from database @Summary Get all groups @Description Get all groups @Tags groups @Accept json @Produce json @Success 200 {object} response.HTTP{data=[]Group} @Router /v1/groups [get]
func Join ¶
func Join(c *fiber.Ctx) error
Join function assign an user to specific group @Summary Joining group chat or conference @Description Joining group chat or conference @Tags groups @Accept json @Produce json @Param group body JoinGroup true "Join group" @Success 200 {object} response.HTTP{data=Group} @Security ApiKeyAuth @Router /v1/join-groups [post]
func Leave ¶
func Leave(c *fiber.Ctx) error
Leave function remove an user from specific group @Summary Leaving group chat or conference @Description Leaving group chat or conference @Tags groups @Accept json @Produce json @Param group body LeaveGroup true "Leave group" @Success 200 {object} response.HTTP{data=Group} @Security ApiKeyAuth @Router /v1/leave-groups [post]
func New ¶
func New(c *fiber.Ctx) error
New function creates a group/conference for communicate with deaf people @Summary Create a group chat or conference @Description Create a group chat or conference @Tags groups @Accept json @Produce json @Param group body CreateGroup true "Create group" @Success 200 {object} response.HTTP{data=Group} @Security ApiKeyAuth @Router /v1/groups [post]
Types ¶
type CreateGroup ¶
type CreateGroup struct {
Type string `json:"type"`
}
CreateGroup is a data transfer object for create group
type Group ¶
type Group struct { gorm.Model AdminID uint `json:"admin_id"` AdminUsername string `json:"admin_username"` Admin user.User `json:"admin"` Type string `json:"type"` Participants []user.User `json:"participants" gorm:"many2many:group_participants;"` }
Group is a model for group chat
type JoinGroup ¶
type JoinGroup struct {
AdminUsername string `json:"admin_username"`
}
JoinGroup is a data transfer object for joining group
type LeaveGroup ¶
type LeaveGroup struct { AdminUsername string `json:"admin_username"` RemainingTime int64 `json:"remaining_time"` }
LeaveGroup is a data transfer object for leaving group