group

package
v0.0.0-...-c1aec90 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL