Documentation ¶
Index ¶
- Constants
- Variables
- func BroadcastStats(streamsDao dao.StreamsDao)
- func CollectStats(daoWrapper dao.DaoWrapper) func()
- func ConfigChatRouter(router *gin.RouterGroup)
- func ConfigGinRouter(router *gin.Engine)
- func ConfigRealtimeRouter(router *gin.RouterGroup)
- func CreateStreamRequest(daoWrapper dao.DaoWrapper, stream model.Stream, course model.Course, ...)
- func DeleteVideoSectionImage(workerDao dao.WorkerDao, path string) error
- func FetchLivePreviews(daoWrapper dao.DaoWrapper) func()
- func GenerateVideoSectionImages(daoWrapper dao.DaoWrapper, parameters *generateVideoSectionImagesParameters) error
- func NotifyLiveUpdateCourseWentLive(courseId uint)
- func NotifyViewersLiveState(streamId uint, live bool)
- func NotifyWorkers(daoWrapper dao.DaoWrapper) func()
- func NotifyWorkersToStopStream(stream model.Stream, discardVoD bool, daoWrapper dao.DaoWrapper)
- func RegenerateThumbs(daoWrapper dao.DaoWrapper, file model.File, stream *model.Stream, ...) error
- func RegisterLiveUpdateRealtimeChannel()
- func RegisterRealtimeChatChannel()
- func ServeWorkerGRPC()
- type AddBookmarkRequest
- type CalendarEntry
- type GetBookmarksQuery
- type MailTmpl
- type MeiliSearchMap
- type SearchCourseDTO
- type SearchStreamDTO
- type SearchSubtitlesDTO
- type SubtitleGeneratorClient
- type UpdateBookmarkRequest
- type UpdateVideoSectionRequest
Constants ¶
const ( POLL_START_MSG = "start_poll" POLL_CLOSE_MSG = "close_active_poll" POLL_PARTICIPATION_MSG = "submit_poll_option_vote" )
const ( WorkerHTTPPort = "8060" CutOffLength = 256 )
const ( LiveUpdateRoomName = "live-update" UpdateTypeCourseWentLive = "course_went_live" )
const ( FilterMaxCoursesCount = 3 DefaultLimit = 10 )
const ( TypeServerInfo = "info" TypeServerWarn = "warn" TypeServerErr = "error" )
const (
ChatRoomName = "chat/:streamID"
)
const (
MAX_FILE_SIZE = 1000 * 1000 * 50 // 50 MB
)
Variables ¶
var RealtimeInstance = realtime.New(connector.NewMelodyConnector())
Functions ¶
func BroadcastStats ¶
func BroadcastStats(streamsDao dao.StreamsDao)
func CollectStats ¶
func CollectStats(daoWrapper dao.DaoWrapper) func()
func ConfigChatRouter ¶
func ConfigChatRouter(router *gin.RouterGroup)
ConfigChatRouter configure gin router for chat (without gzip)
func ConfigGinRouter ¶
ConfigGinRouter for non ws endpoints
func ConfigRealtimeRouter ¶
func ConfigRealtimeRouter(router *gin.RouterGroup)
ConfigRealtimeRouter configure gin router for live-updates (without gzip)
func CreateStreamRequest ¶
func DeleteVideoSectionImage ¶
func FetchLivePreviews ¶
func FetchLivePreviews(daoWrapper dao.DaoWrapper) func()
FetchLivePreviews gets a live thumbnail from a worker.
func GenerateVideoSectionImages ¶
func GenerateVideoSectionImages(daoWrapper dao.DaoWrapper, parameters *generateVideoSectionImagesParameters) error
func NotifyLiveUpdateCourseWentLive ¶
func NotifyLiveUpdateCourseWentLive(courseId uint)
func NotifyViewersLiveState ¶
func NotifyWorkers ¶
func NotifyWorkers(daoWrapper dao.DaoWrapper) func()
NotifyWorkers collects all streams that are due to stream (starts in the next 10 minutes from a lecture hall) and invokes the corresponding calls at the workers with the least workload via gRPC
func NotifyWorkersToStopStream ¶
func NotifyWorkersToStopStream(stream model.Stream, discardVoD bool, daoWrapper dao.DaoWrapper)
NotifyWorkersToStopStream notifies all workers for a given stream to quit encoding
func RegenerateThumbs ¶
func RegenerateThumbs(daoWrapper dao.DaoWrapper, file model.File, stream *model.Stream, course *model.Course) error
RegenerateThumbs regenerates the thumbnails for the timeline. This is useful for video with faulty thumbnails and for VoDs that were created before the thumbnail feature.
func RegisterLiveUpdateRealtimeChannel ¶
func RegisterLiveUpdateRealtimeChannel()
func RegisterRealtimeChatChannel ¶
func RegisterRealtimeChatChannel()
func ServeWorkerGRPC ¶
func ServeWorkerGRPC()
ServeWorkerGRPC initializes a gRPC server on port 50052
Types ¶
type AddBookmarkRequest ¶
type AddBookmarkRequest struct { StreamID uint `json:"streamID"` Description string `json:"description"` Hours uint `json:"hours"` Minutes uint `json:"minutes"` Seconds uint `json:"seconds"` }
func (AddBookmarkRequest) ToBookmark ¶
func (r AddBookmarkRequest) ToBookmark(userID uint) model.Bookmark
type CalendarEntry ¶
type GetBookmarksQuery ¶
type GetBookmarksQuery struct {
StreamID uint `form:"streamID" binding:"required"`
}
type MeiliSearchMap ¶ added in v1.4.23
type SearchCourseDTO ¶ added in v1.4.23
type SearchCourseDTO struct { Name string `json:"name"` Slug string `json:"slug"` Year int `json:"year"` TeachingTerm string `json:"semester"` }
func ToSearchCourseDTO ¶ added in v1.4.23
func ToSearchCourseDTO(cs ...model.Course) []SearchCourseDTO
ToSearchCourseDTO converts Courses to slice of SearchCourseDTO
type SearchStreamDTO ¶ added in v1.4.23
type SearchStreamDTO struct { ID uint `json:"ID"` Name string `json:"name"` Description string `json:"description"` CourseName string `json:"courseName"` Year int `json:"year"` TeachingTerm string `json:"semester"` CourseSlug string `json:"courseSlug"` }
func ToSearchStreamDTO ¶ added in v1.4.23
func ToSearchStreamDTO(wrapper dao.DaoWrapper, streams ...model.Stream) []SearchStreamDTO
ToSearchStreamDTO converts Streams to slice of SearchStreamDTO
Ignores any errors and sets affected fields to zero value
type SearchSubtitlesDTO ¶ added in v1.4.23
type SearchSubtitlesDTO struct { StreamID uint `json:"streamID"` Timestamp int64 `json:"timestamp"` TextPrev string `json:"textPrev"` // the previous subtitle line Text string `json:"text"` TextNext string `json:"textNext"` // the next subtitle line StreamName string `json:"streamName"` StreamStartTime time.Time `json:"streamStartTime"` StreamEndTime time.Time `json:"streamEndTime"` CourseName string `json:"courseName"` CourseSlug string `json:"courseSlug"` CourseYear int `json:"year"` CourseTeachingTerm string `json:"semester"` }
func ToSearchSubtitleDTO ¶ added in v1.4.23
func ToSearchSubtitleDTO(wrapper dao.DaoWrapper, subtitles ...tools.MeiliSubtitles) []SearchSubtitlesDTO
ToSearchSubtitleDTO converts MeiliSubtitles to slice of SearchSubtitlesDTO
Ignores any errors and sets affected fields to zero value
type SubtitleGeneratorClient ¶
type SubtitleGeneratorClient struct { pb.SubtitleGeneratorClient *grpc.ClientConn }
func GetSubtitleGeneratorClient ¶
func GetSubtitleGeneratorClient() (SubtitleGeneratorClient, error)
func (SubtitleGeneratorClient) CloseConn ¶
func (s SubtitleGeneratorClient) CloseConn()
type UpdateBookmarkRequest ¶
type UpdateBookmarkRequest struct { Description string `json:"description"` Hours uint `json:"hours"` Minutes uint `json:"minutes"` Seconds uint `json:"seconds"` }
func (UpdateBookmarkRequest) ToBookmark ¶
func (r UpdateBookmarkRequest) ToBookmark(id uint) model.Bookmark
Source Files ¶
- api_logger.go
- audit.go
- bookmarks.go
- chat.go
- courseimport.go
- courses.go
- download.go
- download_ics.go
- info-pages.go
- lecture_halls.go
- live_update.go
- maintenance.go
- notifications.go
- progress.go
- realtime.go
- router.go
- search.go
- seek_stats.go
- semesters.go
- server-notifications.go
- statistics.go
- stream.go
- token.go
- users.go
- voice_service_grpc.go
- worker.go
- worker_grpc.go
- wsHub.go