api

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POLL_START_MSG         = "start_poll"
	POLL_CLOSE_MSG         = "close_active_poll"
	POLL_PARTICIPATION_MSG = "submit_poll_option_vote"
)
View Source
const (
	WorkerHTTPPort = "8060"
	CutOffLength   = 256
)
View Source
const (
	LiveUpdateRoomName       = "live-update"
	UpdateTypeCourseWentLive = "course_went_live"
)
View Source
const (
	TypeServerInfo = "info"
	TypeServerWarn = "warn"
	TypeServerErr  = "error"
)
View Source
const (
	ChatRoomName = "chat/:streamID"
)
View Source
const (
	MAX_FILE_SIZE = 1000 * 1000 * 50 // 50 MB
)

Variables

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

func ConfigGinRouter(router *gin.Engine)

ConfigGinRouter for non ws endpoints

func ConfigRealtimeRouter added in v1.1.2

func ConfigRealtimeRouter(router *gin.RouterGroup)

ConfigRealtimeRouter configure gin router for live-updates (without gzip)

func CreateStreamRequest added in v1.1.8

func CreateStreamRequest(daoWrapper dao.DaoWrapper, stream model.Stream, course model.Course, workers []model.Worker, sourceType string, source string)

func DeleteVideoSectionImage added in v1.0.8

func DeleteVideoSectionImage(workerDao dao.WorkerDao, path string) error

func FetchLivePreviews added in v1.2.16

func FetchLivePreviews(daoWrapper dao.DaoWrapper) func()

FetchLivePreviews gets a live thumbnail from a worker.

func GenerateVideoSectionImages added in v1.0.8

func GenerateVideoSectionImages(daoWrapper dao.DaoWrapper, parameters *generateVideoSectionImagesParameters) error

func NotifyLiveUpdateCourseWentLive added in v1.1.0

func NotifyLiveUpdateCourseWentLive(courseId uint)

func NotifyViewersLiveState

func NotifyViewersLiveState(streamId uint, live bool)

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 added in v1.1.25

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 added in v1.1.2

func RegisterLiveUpdateRealtimeChannel()

func RegisterRealtimeChatChannel added in v1.1.2

func RegisterRealtimeChatChannel()

func ServeWorkerGRPC added in v1.1.21

func ServeWorkerGRPC()

ServeWorkerGRPC initializes a gRPC server on port 50052

Types

type AddBookmarkRequest added in v1.1.1

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 added in v1.1.1

func (r AddBookmarkRequest) ToBookmark(userID uint) model.Bookmark

type CalendarEntry added in v1.0.4

type CalendarEntry struct {
	CreatedAt   string
	Start       string
	End         string
	ID          string
	Url         string
	Location    string
	Summary     string
	Description string
}

type GetBookmarksQuery added in v1.1.1

type GetBookmarksQuery struct {
	StreamID uint `form:"streamID" binding:"required"`
}

type MailTmpl

type MailTmpl struct {
	Name   string
	OptIn  bool
	Course model.Course
	Users  []*model.User
}

type SubtitleGeneratorClient added in v1.2.13

type SubtitleGeneratorClient struct {
	pb.SubtitleGeneratorClient
	*grpc.ClientConn
}

func GetSubtitleGeneratorClient added in v1.2.13

func GetSubtitleGeneratorClient() (SubtitleGeneratorClient, error)

func (SubtitleGeneratorClient) CloseConn added in v1.2.13

func (s SubtitleGeneratorClient) CloseConn()

type UpdateBookmarkRequest added in v1.1.1

type UpdateBookmarkRequest struct {
	Description string `json:"description"`
	Hours       uint   `json:"hours"`
	Minutes     uint   `json:"minutes"`
	Seconds     uint   `json:"seconds"`
}

func (UpdateBookmarkRequest) ToBookmark added in v1.1.1

func (r UpdateBookmarkRequest) ToBookmark(id uint) model.Bookmark

type UpdateVideoSectionRequest added in v1.1.22

type UpdateVideoSectionRequest struct {
	Description  string `json:"description"`
	StartHours   uint   `json:"startHours"`
	StartMinutes uint   `json:"startMinutes"`
	StartSeconds uint   `json:"startSeconds"`
}

Jump to

Keyboard shortcuts

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