models

package
v1.5.14 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion  = "1.3.0"
	EtherpadKey = "pnm:etherpad:"
)
View Source
const (
	BlockedUsersList           = "pnm:block_users_list:"
	ActiveRoomsWithMetadataKey = "pnm:activeRoomsWithMetadata"
	ActiveRoomUsers            = "pnm:activeRoom:%s:users"
	RoomWithUsersMetadata      = "pnm:roomWithUsersMetadata:%s"
)
View Source
const SpeechServiceRedisKey = "pnm:speechService"

Variables

This section is empty.

Functions

func DistributeWebsocketMsgToRedisChannel

func DistributeWebsocketMsgToRedisChannel(payload *WebsocketToRedis)

func GetWebhookNotifier added in v1.5.6

func GetWebhookNotifier(roomId, roomSid string) *webhook.WebhookNotifier

func NewWebhookModel

func NewWebhookModel(e *livekit.WebhookEvent)

func RegisterRoomForWebhook added in v1.5.6

func RegisterRoomForWebhook(roomId, roomSid string)

RegisterRoomForWebhook will check if room exist already or not if not then it will add it's important to call this method from roomStarted, otherwise new room won't be adding

func SubscribeToSystemWebsocketChannel

func SubscribeToSystemWebsocketChannel()

SubscribeToSystemWebsocketChannel will delivery message to websocket

func SubscribeToUserWebsocketChannel

func SubscribeToUserWebsocketChannel()

SubscribeToUserWebsocketChannel will delivery message to user websocket

func SubscribeToWhiteboardWebsocketChannel

func SubscribeToWhiteboardWebsocketChannel()

SubscribeToWhiteboardWebsocketChannel will delivery message to whiteboard websocket

Types

type AnalyticsAuthModel added in v1.5.0

type AnalyticsAuthModel struct {
	// contains filtered or unexported fields
}

func NewAnalyticsAuthModel added in v1.5.0

func NewAnalyticsAuthModel() *AnalyticsAuthModel

func (*AnalyticsAuthModel) DeleteAnalytics added in v1.5.0

func (m *AnalyticsAuthModel) DeleteAnalytics(r *plugnmeet.DeleteAnalyticsReq) error

func (*AnalyticsAuthModel) FetchAnalytics added in v1.5.0

func (*AnalyticsAuthModel) GetAnalyticsDownloadToken added in v1.5.0

func (m *AnalyticsAuthModel) GetAnalyticsDownloadToken(r *plugnmeet.GetAnalyticsDownloadTokenReq) (string, error)

GetAnalyticsDownloadToken will use the same JWT token generator as plugNmeet is using

func (*AnalyticsAuthModel) VerifyAnalyticsToken added in v1.5.0

func (m *AnalyticsAuthModel) VerifyAnalyticsToken(token string) (string, int, error)

VerifyAnalyticsToken verify token & provide file path

type AnalyticsModel added in v1.5.0

type AnalyticsModel struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewAnalyticsModel added in v1.5.0

func NewAnalyticsModel() *AnalyticsModel

func (*AnalyticsModel) HandleEvent added in v1.5.0

func (m *AnalyticsModel) HandleEvent(d *plugnmeet.AnalyticsDataMsg)

func (*AnalyticsModel) HandleWebSocketData added in v1.5.0

func (m *AnalyticsModel) HandleWebSocketData(dataMsg *plugnmeet.DataMessage)

func (*AnalyticsModel) PrepareToExportAnalytics added in v1.5.0

func (m *AnalyticsModel) PrepareToExportAnalytics(roomId, sid, meta string)

type AuthRecording added in v1.3.1

type AuthRecording struct {
	// contains filtered or unexported fields
}

func NewRecordingAuth

func NewRecordingAuth() *AuthRecording

func (*AuthRecording) CreateTokenForDownload added in v1.5.13

func (a *AuthRecording) CreateTokenForDownload(path string) (string, error)

CreateTokenForDownload will generate token path format: sub_path/roomSid/filename

func (*AuthRecording) DeleteRecording added in v1.3.1

func (a *AuthRecording) DeleteRecording(r *plugnmeet.DeleteRecordingReq) error

func (*AuthRecording) FetchRecording added in v1.3.1

func (a *AuthRecording) FetchRecording(recordId string) (*plugnmeet.RecordingInfo, error)

FetchRecording to get single recording information from DB

func (*AuthRecording) FetchRecordings added in v1.3.1

func (*AuthRecording) GetDownloadToken added in v1.3.1

func (a *AuthRecording) GetDownloadToken(r *plugnmeet.GetDownloadTokenReq) (string, error)

GetDownloadToken will use the same JWT token generator as plugNmeet is using

func (*AuthRecording) RecordingInfo added in v1.5.10

func (*AuthRecording) VerifyRecordingToken added in v1.3.1

func (a *AuthRecording) VerifyRecordingToken(token string) (string, int, error)

VerifyRecordingToken verify token & provide file path

type AuthTokenModel added in v1.3.1

type AuthTokenModel struct {
	// contains filtered or unexported fields
}

func NewAuthTokenModel

func NewAuthTokenModel() *AuthTokenModel

func (*AuthTokenModel) DoRenewPlugNmeetToken added in v1.5.8

func (a *AuthTokenModel) DoRenewPlugNmeetToken(token string) (string, error)

DoRenewPlugNmeetToken we'll renew token

func (*AuthTokenModel) GenerateLivekitToken added in v1.3.1

func (a *AuthTokenModel) GenerateLivekitToken(c *plugnmeet.PlugNmeetTokenClaims) (string, error)

func (*AuthTokenModel) GeneratePlugNmeetAccessToken added in v1.5.8

func (a *AuthTokenModel) GeneratePlugNmeetAccessToken(g *plugnmeet.GenerateTokenReq) (string, error)

func (*AuthTokenModel) ValidateLivekitWebhookToken added in v1.5.8

func (a *AuthTokenModel) ValidateLivekitWebhookToken(body []byte, token string) (bool, error)

func (*AuthTokenModel) VerifyPlugNmeetAccessToken added in v1.5.8

func (a *AuthTokenModel) VerifyPlugNmeetAccessToken(token string) (*plugnmeet.PlugNmeetTokenClaims, error)

type BBBApiWrapperModel added in v1.5.13

type BBBApiWrapperModel struct {
	// contains filtered or unexported fields
}

func NewBBBApiWrapperModel added in v1.5.13

func NewBBBApiWrapperModel() *BBBApiWrapperModel

func (*BBBApiWrapperModel) GetRecordings added in v1.5.13

type BreakoutRoom

type BreakoutRoom struct {
	// contains filtered or unexported fields
}

func NewBreakoutRoomModel

func NewBreakoutRoomModel() *BreakoutRoom

func (*BreakoutRoom) CreateBreakoutRooms added in v1.3.1

func (m *BreakoutRoom) CreateBreakoutRooms(r *plugnmeet.CreateBreakoutRoomsReq) error

func (*BreakoutRoom) EndBreakoutRoom added in v1.3.1

func (m *BreakoutRoom) EndBreakoutRoom(r *plugnmeet.EndBreakoutRoomReq) error

func (*BreakoutRoom) EndBreakoutRooms added in v1.3.1

func (m *BreakoutRoom) EndBreakoutRooms(roomId string) error

func (*BreakoutRoom) GetBreakoutRooms added in v1.3.1

func (m *BreakoutRoom) GetBreakoutRooms(roomId string) ([]*plugnmeet.BreakoutRoom, error)

func (*BreakoutRoom) GetMyBreakoutRooms added in v1.3.1

func (m *BreakoutRoom) GetMyBreakoutRooms(roomId, userId string) (*plugnmeet.BreakoutRoom, error)

func (*BreakoutRoom) IncreaseBreakoutRoomDuration added in v1.3.1

func (m *BreakoutRoom) IncreaseBreakoutRoomDuration(r *plugnmeet.IncreaseBreakoutRoomDurationReq) error

func (*BreakoutRoom) JoinBreakoutRoom added in v1.3.1

func (m *BreakoutRoom) JoinBreakoutRoom(r *plugnmeet.JoinBreakoutRoomReq) (string, error)

func (*BreakoutRoom) PostTaskAfterRoomEndWebhook added in v1.3.1

func (m *BreakoutRoom) PostTaskAfterRoomEndWebhook(roomId, metadata string) error

func (*BreakoutRoom) PostTaskAfterRoomStartWebhook added in v1.3.1

func (m *BreakoutRoom) PostTaskAfterRoomStartWebhook(roomId string, metadata *plugnmeet.RoomMetadata) error

func (*BreakoutRoom) SendBreakoutRoomMsg added in v1.3.1

func (m *BreakoutRoom) SendBreakoutRoomMsg(r *plugnmeet.BroadcastBreakoutRoomMsgReq) error

type ConvertWhiteboardFileRes

type ConvertWhiteboardFileRes struct {
	FileName   string `json:"file_name"`
	FileId     string `json:"file_id"`
	FilePath   string `json:"file_path"`
	TotalPages int    `json:"total_pages"`
}

type CreateSessionRes

type CreateSessionRes struct {
	PadId         string
	ReadOnlyPadId string
}

type DataMessageModel added in v1.3.1

type DataMessageModel struct {
	// contains filtered or unexported fields
}

func NewDataMessageModel added in v1.2.0

func NewDataMessageModel() *DataMessageModel

func (*DataMessageModel) SendDataMessage added in v1.3.1

func (m *DataMessageModel) SendDataMessage(r *plugnmeet.DataMessageReq) error

func (*DataMessageModel) SendUpdatedMetadata added in v1.4.1

func (m *DataMessageModel) SendUpdatedMetadata(roomId, metadata string) error

type DataMessageReq

type DataMessageReq struct {
	Sid             string   `json:"sid"`
	RoomId          string   `json:"room_id"`
	MsgType         string   `json:"msg_type"`
	Msg             string   `json:"msg"`
	RequestedUserId string   `json:"-"`
	SendTo          []string // user sids
	IsAdmin         bool
	// contains filtered or unexported fields
}

type EtherpadDataTypes

type EtherpadDataTypes struct {
	AuthorID        string `json:"authorID"`
	GroupID         string `json:"groupID"`
	SessionID       string `json:"sessionID"`
	PadID           string `json:"padID"`
	ReadOnlyID      string `json:"readOnlyID"`
	TotalPads       int64  `json:"totalPads"`
	TotalSessions   int64  `json:"totalSessions"`
	TotalActivePads int64  `json:"totalActivePads"`
}

type EtherpadHttpRes

type EtherpadHttpRes struct {
	Code    int64             `json:"code"`
	Message string            `json:"message"`
	Data    EtherpadDataTypes `json:"data"`
}

type EtherpadModel

type EtherpadModel struct {
	SharedNotePad config.SharedNotePad
	NodeId        string
	Host          string
	ApiKey        string
	// contains filtered or unexported fields
}

func NewEtherpadModel

func NewEtherpadModel() *EtherpadModel

func (*EtherpadModel) ChangeEtherpadStatus

func (m *EtherpadModel) ChangeEtherpadStatus(r *plugnmeet.ChangeEtherpadStatusReq) error

func (*EtherpadModel) CleanAfterRoomEnd

func (m *EtherpadModel) CleanAfterRoomEnd(roomId, metadata string) error

func (*EtherpadModel) CleanPad

func (m *EtherpadModel) CleanPad(roomId, nodeId, padId string) error

CleanPad will delete group, session & pad

func (*EtherpadModel) CreateSession

func (m *EtherpadModel) CreateSession(roomId, requestedUserId string) (*plugnmeet.CreateEtherpadSessionRes, error)

CreateSession will create group, pad, session return padId, readonlyPadId

type ExternalDisplayLink struct {
	// contains filtered or unexported fields
}

func NewExternalDisplayLinkModel

func NewExternalDisplayLinkModel() *ExternalDisplayLink

func (*ExternalDisplayLink) PerformTask added in v1.3.1

type ExternalMediaPlayer

type ExternalMediaPlayer struct {
	// contains filtered or unexported fields
}

func NewExternalMediaPlayerModel

func NewExternalMediaPlayerModel() *ExternalMediaPlayer

func (*ExternalMediaPlayer) PerformTask

type IngressModel added in v1.3.4

type IngressModel struct {
	// contains filtered or unexported fields
}

func NewIngressModel added in v1.3.4

func NewIngressModel() *IngressModel

func (*IngressModel) CreateIngress added in v1.3.4

type LTIV1

type LTIV1 struct {
	// contains filtered or unexported fields
}

func NewLTIV1Model

func NewLTIV1Model() *LTIV1

func (*LTIV1) LTIV1JoinRoom

func (m *LTIV1) LTIV1JoinRoom(c *plugnmeet.LtiClaims) (string, error)

func (*LTIV1) LTIV1Landing

func (m *LTIV1) LTIV1Landing(c *fiber.Ctx, requests, signingURL string) error

func (*LTIV1) LTIV1VerifyHeaderToken

func (m *LTIV1) LTIV1VerifyHeaderToken(token string) (*LtiClaims, error)

func (*LTIV1) ToJWT

func (m *LTIV1) ToJWT(c *plugnmeet.LtiClaims) (string, error)

func (*LTIV1) VerifyAuth

func (m *LTIV1) VerifyAuth(requests, signingURL string) (*url.Values, error)

type LTIV1FetchRecordingsReq

type LTIV1FetchRecordingsReq struct {
	From    uint32 `json:"from"`
	Limit   uint32 `json:"limit"`
	OrderBy string `json:"order_by"`
}

type LtiClaims

type LtiClaims struct {
	UserId              string               `json:"user_id"`
	Name                string               `json:"name"`
	IsAdmin             bool                 `json:"is_admin"`
	RoomId              string               `json:"room_id"`
	RoomTitle           string               `json:"room_title"`
	LtiCustomParameters *LtiCustomParameters `json:"lti_custom_parameters,omitempty"`
}

type LtiCustomDesign

type LtiCustomDesign struct {
	PrimaryColor    string `json:"primary_color,omitempty"`
	SecondaryColor  string `json:"secondary_color,omitempty"`
	BackgroundColor string `json:"background_color,omitempty"`
}

type LtiCustomParameters

type LtiCustomParameters struct {
	RoomDuration               uint64           `json:"room_duration,omitempty"`
	AllowPolls                 *bool            `json:"allow_polls,omitempty"`
	AllowSharedNotePad         *bool            `json:"allow_shared_note_pad,omitempty"`
	AllowBreakoutRoom          *bool            `json:"allow_breakout_room,omitempty"`
	AllowRecording             *bool            `json:"allow_recording,omitempty"`
	AllowRTMP                  *bool            `json:"allow_rtmp,omitempty"`
	AllowViewOtherWebcams      *bool            `json:"allow_view_other_webcams,omitempty"`
	AllowViewOtherParticipants *bool            `json:"allow_view_other_users_list,omitempty"`
	MuteOnStart                *bool            `json:"mute_on_start,omitempty"`
	LtiCustomDesign            *LtiCustomDesign `json:"lti_custom_design,omitempty"`
}

type ManageFile

type ManageFile struct {
	Sid       string `json:"sid"`
	RoomId    string `json:"roomId"`
	UserId    string `json:"userId"`
	FilePath  string `json:"file_path"`
	Resumable bool   `json:"resumable"`
	// contains filtered or unexported fields
}

func NewManageFileModel

func NewManageFileModel(m *ManageFile) *ManageFile

func (*ManageFile) CommonValidation

func (m *ManageFile) CommonValidation(c *fiber.Ctx) error

func (*ManageFile) ConvertWhiteboardFile

func (m *ManageFile) ConvertWhiteboardFile() (*ConvertWhiteboardFileRes, error)

func (*ManageFile) DeleteFile

func (m *ManageFile) DeleteFile(filePath string) error

func (*ManageFile) DeleteRoomUploadedDir

func (m *ManageFile) DeleteRoomUploadedDir() error

func (*ManageFile) ResumableFileUpload

func (m *ManageFile) ResumableFileUpload(c *fiber.Ctx) (*UploadedFileResponse, error)

ResumableFileUpload method can only be use if you are using resumable.js as your frontend. Library link: https://github.com/23/resumable.js

type MuteUnMuteTrackReq

type MuteUnMuteTrackReq struct {
	Sid             string `json:"sid" validate:"required"`
	RoomId          string `json:"room_id" validate:"required"`
	UserId          string `json:"user_id" validate:"required"`
	TrackSid        string `json:"track_sid"`
	Muted           bool   `json:"muted"`
	RequestedUserId string `json:"-"`
}

type PollsModel added in v1.3.1

type PollsModel struct {
	// contains filtered or unexported fields
}

func NewPollsModel

func NewPollsModel() *PollsModel

func (*PollsModel) CleanUpPolls added in v1.3.1

func (m *PollsModel) CleanUpPolls(roomId string) error

func (*PollsModel) ClosePoll added in v1.3.1

func (m *PollsModel) ClosePoll(r *plugnmeet.ClosePollReq, isAdmin bool) error

func (*PollsModel) CreatePoll added in v1.3.1

func (m *PollsModel) CreatePoll(r *plugnmeet.CreatePollReq, isAdmin bool) (error, string)

func (*PollsModel) GetPollResponsesByField added in v1.3.1

func (m *PollsModel) GetPollResponsesByField(roomId, pollId, field string) (error, string)

func (*PollsModel) GetPollResponsesDetails added in v1.3.1

func (m *PollsModel) GetPollResponsesDetails(roomId, pollId string) (error, map[string]string)

func (*PollsModel) GetPollsStats added in v1.3.1

func (m *PollsModel) GetPollsStats(roomId string) (*plugnmeet.PollsStats, error)

func (*PollsModel) GetResponsesResult added in v1.3.1

func (m *PollsModel) GetResponsesResult(roomId, pollId string) (*plugnmeet.PollResponsesResult, error)

func (*PollsModel) ListPolls added in v1.3.1

func (m *PollsModel) ListPolls(roomId string) (error, []*plugnmeet.PollInfo)

func (*PollsModel) UserSelectedOption added in v1.3.1

func (m *PollsModel) UserSelectedOption(roomId, pollId, userId string) (uint64, error)

func (*PollsModel) UserSubmitResponse added in v1.3.1

func (m *PollsModel) UserSubmitResponse(r *plugnmeet.SubmitPollResponseReq, isAdmin bool) error

type RecorderModel added in v1.4.0

type RecorderModel struct {
	// contains filtered or unexported fields
}

func NewRecorderModel added in v1.4.0

func NewRecorderModel() *RecorderModel

func (*RecorderModel) SendMsgToRecorder added in v1.4.0

func (r *RecorderModel) SendMsgToRecorder(req *plugnmeet.RecordingReq) error

type RecorderReq

type RecorderReq struct {
	From        string `json:"from"`
	Task        string `json:"task"`
	RoomId      string `json:"room_id"`
	Sid         string `json:"sid"`
	RecordId    string `json:"record_id"`
	AccessToken string `json:"access_token"`
	RecorderId  string `json:"recorder_id"`
	RtmpUrl     string `json:"rtmp_url"`
}

type RecorderResp

type RecorderResp struct {
	RecorderId string `json:"recorder_id"` //
	MaxLimit   int    `json:"max_limit"`

	From     string  `json:"from"`
	Task     string  `json:"task"`
	Status   bool    `json:"status"`
	Msg      string  `json:"msg"`
	RecordId string  `json:"record_id"`
	Sid      string  `json:"sid"`
	RoomId   string  `json:"room_id"`
	FilePath string  `json:"file_path"`
	FileSize float64 `json:"file_size"`
}

type RecordingModel added in v1.3.1

type RecordingModel struct {
	// contains filtered or unexported fields
}

func NewRecordingModel

func NewRecordingModel() *RecordingModel

func (*RecordingModel) HandleRecorderResp added in v1.3.1

func (rm *RecordingModel) HandleRecorderResp(r *plugnmeet.RecorderToPlugNmeet, roomInfo *RoomInfo)

type RenewTokenReq added in v1.5.8

type RenewTokenReq struct {
	Token string `json:"token"`
}

type ReqFrom

type ReqFrom struct {
	Sid    string `json:"sid"`
	UserId string `json:"userId"`
	Name   string `json:"name"`
}

type RoomAuthModel added in v1.3.1

type RoomAuthModel struct {
	// contains filtered or unexported fields
}

func NewRoomAuthModel

func NewRoomAuthModel() *RoomAuthModel

func (*RoomAuthModel) ChangeVisibility added in v1.3.1

func (am *RoomAuthModel) ChangeVisibility(r *plugnmeet.ChangeVisibilityRes) (bool, string)

func (*RoomAuthModel) CreateRoom added in v1.3.1

func (am *RoomAuthModel) CreateRoom(r *plugnmeet.CreateRoomReq) (bool, string, *livekit.Room)

func (*RoomAuthModel) EndRoom added in v1.3.1

func (am *RoomAuthModel) EndRoom(r *plugnmeet.RoomEndReq) (bool, string)

func (*RoomAuthModel) FetchPastRooms added in v1.5.0

func (*RoomAuthModel) GetActiveRoomInfo added in v1.3.1

func (*RoomAuthModel) GetActiveRoomsInfo added in v1.3.1

func (am *RoomAuthModel) GetActiveRoomsInfo() (bool, string, []*plugnmeet.ActiveRoomWithParticipant)

func (*RoomAuthModel) IsRoomActive added in v1.3.1

type RoomDurationInfo added in v1.5.4

type RoomDurationInfo struct {
	Duration  uint64 `redis:"duration"`
	StartedAt uint64 `redis:"startedAt"`
}

type RoomDurationModel added in v1.5.4

type RoomDurationModel struct {
	// contains filtered or unexported fields
}

func NewRoomDurationModel added in v1.5.4

func NewRoomDurationModel() *RoomDurationModel

func (*RoomDurationModel) AddRoomWithDurationInfo added in v1.5.4

func (m *RoomDurationModel) AddRoomWithDurationInfo(roomId string, r RoomDurationInfo) error

func (*RoomDurationModel) CompareDurationWithParentRoom added in v1.5.4

func (m *RoomDurationModel) CompareDurationWithParentRoom(mainRoomId string, duration uint64) error

func (*RoomDurationModel) DeleteRoomWithDuration added in v1.5.4

func (m *RoomDurationModel) DeleteRoomWithDuration(roomId string) error

func (*RoomDurationModel) GetRoomDurationInfo added in v1.5.4

func (m *RoomDurationModel) GetRoomDurationInfo(roomId string) (*RoomDurationInfo, error)

func (*RoomDurationModel) GetRoomsWithDurationMap added in v1.5.4

func (m *RoomDurationModel) GetRoomsWithDurationMap() map[string]RoomDurationInfo

func (*RoomDurationModel) IncreaseRoomDuration added in v1.5.4

func (m *RoomDurationModel) IncreaseRoomDuration(roomId string, duration uint64) (uint64, error)

type RoomInfo

type RoomInfo struct {
	Id                 int64
	RoomTitle          string `json:"room_title"`
	RoomId             string `json:"room_id"`
	Sid                string `json:"sid"`
	JoinedParticipants int64  `json:"joined_participants"`
	IsRunning          int    `json:"is_running"`
	IsRecording        int    `json:"is_recording"`
	RecorderId         string `json:"recorder_id"`
	IsActiveRTMP       int    `json:"is_active_rtmp"`
	NodeIdRTMP         string `json:"rtmp_node_id"`
	WebhookUrl         string `json:"webhook_url"`
	IsBreakoutRoom     int64  `json:"is_breakout_room"`
	ParentRoomId       string `json:"parent_room_id"`
	CreationTime       int64  `json:"creation_time"`
	Created            string
	Ended              string
}

type RoomModel added in v1.3.1

type RoomModel struct {
	// contains filtered or unexported fields
}

func NewRoomModel

func NewRoomModel() *RoomModel

func (*RoomModel) GetActiveRoomsInfo added in v1.3.1

func (rm *RoomModel) GetActiveRoomsInfo() ([]*plugnmeet.ActiveRoomInfo, error)

func (*RoomModel) GetRoomInfo added in v1.3.1

func (rm *RoomModel) GetRoomInfo(roomId string, sid string, isRunning int) (*RoomInfo, string)

GetRoomInfo can be used to get room information Note: this won't send nil value, so always need to check if table Id is 0 or not

func (*RoomModel) GetRoomInfoByTableId added in v1.4.0

func (rm *RoomModel) GetRoomInfoByTableId(tableId int64) (*RoomInfo, string)

GetRoomInfoByTableId can be used to get room info by table id will be needed when recorder will send response

func (*RoomModel) InsertOrUpdateRoomData added in v1.3.1

func (rm *RoomModel) InsertOrUpdateRoomData(r *RoomInfo, update bool) (int64, error)

func (*RoomModel) UpdateNumParticipants added in v1.3.1

func (rm *RoomModel) UpdateNumParticipants(roomSid string, num int64) (int64, error)

UpdateNumParticipants will update total number of Participants

func (*RoomModel) UpdateRoomParticipants added in v1.3.1

func (rm *RoomModel) UpdateRoomParticipants(r *RoomInfo, operator string) (int64, error)

UpdateRoomParticipants will increment or decrement number of Participants

func (*RoomModel) UpdateRoomStatus added in v1.3.1

func (rm *RoomModel) UpdateRoomStatus(r *RoomInfo) (int64, error)

UpdateRoomStatus will change the room status based on `is_running` value most of the place this method used to change status to close

type RoomService

type RoomService struct {
	// contains filtered or unexported fields
}

func NewRoomService

func NewRoomService() *RoomService

func (*RoomService) AddUserToBlockList

func (r *RoomService) AddUserToBlockList(roomId, userId string) (int64, error)

AddUserToBlockList will add users to blocklist, we're using redis set

func (*RoomService) CreateRoom

func (r *RoomService) CreateRoom(roomId string, emptyTimeout *uint32, maxParticipants *uint32, metadata string) (*livekit.Room, error)

CreateRoom will create room in livekit

func (*RoomService) DeleteRoomBlockList

func (r *RoomService) DeleteRoomBlockList(roomId string) (int64, error)

DeleteRoomBlockList to completely delete block list set to provided roomId

func (*RoomService) EndRoom

func (r *RoomService) EndRoom(roomId string) (string, error)

EndRoom will send API request to livekit

func (*RoomService) IsUserExistInBlockList

func (r *RoomService) IsUserExistInBlockList(roomId, userId string) bool

IsUserExistInBlockList to check if the user is present in the blocklist

func (*RoomService) LoadOnlyParticipantMetadata added in v1.5.8

func (r *RoomService) LoadOnlyParticipantMetadata(roomId, userId string) (*plugnmeet.UserMetadata, bool, error)

LoadOnlyParticipantMetadata will load participant metadata from our managed redis with online status

func (*RoomService) LoadOnlyRoomMetadata added in v1.5.8

func (r *RoomService) LoadOnlyRoomMetadata(roomId string) (*plugnmeet.RoomMetadata, error)

LoadOnlyRoomMetadata will load metadata from our own redis system we always update our redis metadata when we trigger to update.

func (*RoomService) LoadParticipantInfo added in v1.2.5

func (r *RoomService) LoadParticipantInfo(roomId string, identity string) (*livekit.ParticipantInfo, error)

LoadParticipantInfo will load single participant info by identity

func (*RoomService) LoadParticipantWithMetadata

func (r *RoomService) LoadParticipantWithMetadata(roomId, userId string) (*livekit.ParticipantInfo, *plugnmeet.UserMetadata, error)

LoadParticipantWithMetadata to load participant with proper formatted metadata

func (*RoomService) LoadParticipants added in v1.2.5

func (r *RoomService) LoadParticipants(roomId string) ([]*livekit.ParticipantInfo, error)

LoadParticipants will load all the participants info from livekit

func (*RoomService) LoadRoomInfo

func (r *RoomService) LoadRoomInfo(roomId string) (*livekit.Room, error)

LoadRoomInfo will room information from livekit

func (*RoomService) LoadRoomWithMetadata

func (r *RoomService) LoadRoomWithMetadata(roomId string) (*livekit.Room, *plugnmeet.RoomMetadata, error)

LoadRoomWithMetadata will load room info with proper formatted metadata

func (*RoomService) ManageActiveRoomsWithMetadata added in v1.5.8

func (r *RoomService) ManageActiveRoomsWithMetadata(roomId, task, metadata string) (map[string]string, error)

ManageActiveRoomsWithMetadata will use redis sorted active rooms with their metadata task = add | del | get | fetchAll

func (*RoomService) ManageActiveUsersList added in v1.5.4

func (r *RoomService) ManageActiveUsersList(roomId, userId, task string, timeStamp int64) ([]redis.Z, error)

ManageActiveUsersList will use redis sorted sets to manage active users task = add | del | get | fetchAll | delList (to delete this entire list)

func (*RoomService) ManageRoomWithUsersMetadata added in v1.5.8

func (r *RoomService) ManageRoomWithUsersMetadata(roomId, userId, task, metadata string) (string, error)

ManageRoomWithUsersMetadata can be used to store user metadata in redis this way we'll be able to access info quickly task = add | del | get | delList (to delete this entire list)

func (*RoomService) MarshalParticipantMetadata added in v1.4.0

func (r *RoomService) MarshalParticipantMetadata(meta *plugnmeet.UserMetadata) (string, error)

MarshalParticipantMetadata will create proper json string of user's metadata

func (*RoomService) MarshalRoomMetadata added in v1.4.0

func (r *RoomService) MarshalRoomMetadata(meta *plugnmeet.RoomMetadata) (string, error)

MarshalRoomMetadata will convert metadata struct to proper json format

func (*RoomService) MuteUnMuteTrack

func (r *RoomService) MuteUnMuteTrack(roomId string, userId string, trackSid string, muted bool) (*livekit.MuteRoomTrackResponse, error)

MuteUnMuteTrack can be used to mute/unmute track. This will send request to livekit

func (*RoomService) OnAfterRoomClosed added in v1.5.8

func (r *RoomService) OnAfterRoomClosed(roomId string)

func (*RoomService) RemoveParticipant

func (r *RoomService) RemoveParticipant(roomId string, userId string) (*livekit.RemoveParticipantResponse, error)

RemoveParticipant will send request to livekit to remove user

func (*RoomService) SendData

func (r *RoomService) SendData(roomId string, data []byte, dataPacketKind livekit.DataPacket_Kind, destinationUserIds []string) (*livekit.SendDataResponse, error)

SendData will send a request to livekit for sending data message

func (*RoomService) UnmarshalParticipantMetadata added in v1.4.0

func (r *RoomService) UnmarshalParticipantMetadata(metadata string) (*plugnmeet.UserMetadata, error)

UnmarshalParticipantMetadata will create proper formatted medata from json string

func (*RoomService) UnmarshalRoomMetadata added in v1.4.0

func (r *RoomService) UnmarshalRoomMetadata(metadata string) (*plugnmeet.RoomMetadata, error)

UnmarshalRoomMetadata will convert metadata string to proper format

func (*RoomService) UpdateParticipantMetadata

func (r *RoomService) UpdateParticipantMetadata(roomId string, userId string, metadata string) (*livekit.ParticipantInfo, error)

UpdateParticipantMetadata will directly send request to livekit to update metadata

func (*RoomService) UpdateParticipantMetadataByStruct

func (r *RoomService) UpdateParticipantMetadataByStruct(roomId, userId string, meta *plugnmeet.UserMetadata) (*livekit.ParticipantInfo, error)

UpdateParticipantMetadataByStruct will update user's medata by provided formatted metadata

func (*RoomService) UpdateParticipantPermission

func (r *RoomService) UpdateParticipantPermission(roomId string, userId string, permission *livekit.ParticipantPermission) (*livekit.ParticipantInfo, error)

UpdateParticipantPermission will change user's permission by sending request to livekit

func (*RoomService) UpdateRoomMetadata

func (r *RoomService) UpdateRoomMetadata(roomId string, metadata string) (*livekit.Room, error)

UpdateRoomMetadata will directly send request to livekit to update metadata

func (*RoomService) UpdateRoomMetadataByStruct

func (r *RoomService) UpdateRoomMetadataByStruct(roomId string, meta *plugnmeet.RoomMetadata) (*livekit.Room, error)

UpdateRoomMetadataByStruct to update metadata by providing formatted metadata

type SchedulerModel added in v1.3.1

type SchedulerModel struct {
	// contains filtered or unexported fields
}

func NewSchedulerModel

func NewSchedulerModel() *SchedulerModel

func (*SchedulerModel) StartScheduler added in v1.3.1

func (s *SchedulerModel) StartScheduler()

type SendBreakoutRoomMsgReq

type SendBreakoutRoomMsgReq struct {
	RoomId string
	Msg    string `json:"msg" validate:"required"`
}

type SpeechServices added in v1.4.0

type SpeechServices struct {
	// contains filtered or unexported fields
}

func NewSpeechServices added in v1.4.0

func NewSpeechServices() *SpeechServices

func (*SpeechServices) GenerateAzureToken added in v1.4.0

func (s *SpeechServices) GenerateAzureToken(r *plugnmeet.GenerateAzureTokenReq, requestedUserId string) error

func (*SpeechServices) OnAfterRoomEnded added in v1.4.0

func (s *SpeechServices) OnAfterRoomEnded(roomId, sId string)

func (*SpeechServices) RenewAzureToken added in v1.5.12

func (s *SpeechServices) RenewAzureToken(r *plugnmeet.AzureTokenRenewReq, requestedUserId string) error

func (*SpeechServices) SpeechServiceUserStatus added in v1.4.0

func (s *SpeechServices) SpeechServiceUserStatus(r *plugnmeet.SpeechServiceUserStatusReq) error

func (*SpeechServices) SpeechServiceUsersUsage added in v1.4.0

func (s *SpeechServices) SpeechServiceUsersUsage(roomId, rSid, userId string, task plugnmeet.SpeechServiceUserStatusTasks) error

func (*SpeechServices) SpeechToTextTranslationServiceStatus added in v1.4.0

func (s *SpeechServices) SpeechToTextTranslationServiceStatus(r *plugnmeet.SpeechToTextTranslationReq) error

type UploadedFileResponse

type UploadedFileResponse struct {
	FilePath      string
	FileName      string
	FileExtension string
	FileMimeType  string
}

type UserModel added in v1.3.1

type UserModel struct {
	// contains filtered or unexported fields
}

func NewUserModel

func NewUserModel() *UserModel

func (*UserModel) CommonValidation added in v1.3.1

func (u *UserModel) CommonValidation(c *fiber.Ctx) error

func (*UserModel) MuteUnMuteTrack added in v1.3.1

func (u *UserModel) MuteUnMuteTrack(r *plugnmeet.MuteUnMuteTrackReq) error

MuteUnMuteTrack can be used to mute or unmute track if track_sid wasn't send then it will find the microphone track & mute it for unmute you'll require enabling "enable_remote_unmute: true" in livekit under room settings. For privacy reason we aren't using it.

func (*UserModel) RemoveParticipant added in v1.3.1

func (u *UserModel) RemoveParticipant(r *plugnmeet.RemoveParticipantReq) error

func (*UserModel) SwitchPresenter added in v1.3.1

func (u *UserModel) SwitchPresenter(r *plugnmeet.SwitchPresenterReq) error

func (*UserModel) UpdateUserLockSettings added in v1.3.1

func (u *UserModel) UpdateUserLockSettings(r *plugnmeet.UpdateUserLockSettingsReq) error

type UserWaitingRoomModel added in v1.3.1

type UserWaitingRoomModel struct {
	// contains filtered or unexported fields
}

func NewWaitingRoomModel

func NewWaitingRoomModel() *UserWaitingRoomModel

func (*UserWaitingRoomModel) ApproveWaitingUsers added in v1.3.1

func (u *UserWaitingRoomModel) ApproveWaitingUsers(r *plugnmeet.ApproveWaitingUsersReq) error

func (*UserWaitingRoomModel) UpdateWaitingRoomMessage added in v1.3.1

func (u *UserWaitingRoomModel) UpdateWaitingRoomMessage(r *plugnmeet.UpdateWaitingRoomMessageReq) error

type WebsocketServiceModel added in v1.3.1

type WebsocketServiceModel struct {
	// contains filtered or unexported fields
}

func NewWebsocketService

func NewWebsocketService() *WebsocketServiceModel

func (*WebsocketServiceModel) HandleDataMessages added in v1.3.1

func (w *WebsocketServiceModel) HandleDataMessages(payload *plugnmeet.DataMessage, roomId string, isAdmin bool)

type WebsocketToRedis added in v1.2.0

type WebsocketToRedis struct {
	Type    string                 `json:"type,omitempty"`
	DataMsg *plugnmeet.DataMessage `json:"data_msg,omitempty"`
	RoomId  string                 `json:"room_id,omitempty"`
	IsAdmin bool                   `json:"is_admin,omitempty"`
}

Jump to

Keyboard shortcuts

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