Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TASK_NAME_ENUM = map[TaskKind]string{ TaskNew: "TASK_NEW", TaskSplit: "TASK_SPLIT", TaskMerge: "TASK_MERGE", TaskTranscode: "TASK_TRANSCODE", TaskDash: "TASK_DASH", }
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct { Id primitive.ObjectID `bson:"_id,omitempty" json:"id"` OriginVideo *Video `json:"origin_video"` Kind TaskKind `json:"kind"` TaskSplit *SplitTask `json:"task_split"` TaskTranscode *TranscodeTask `json:"task_transcode"` TaskMerge *MergeTask `json:"task_merge"` TaskDash *DashTask `json:"task_dash"` PrevTask TaskKind `json:"prev_task"` Status TaskStatus `json:"status"` Worker string `gorm:"size:255" json:"worker"` TaskSubmitted time.Time `json:"task_submitted"` // time (approx <1ms) when task submitted to queue TaskStarted time.Time `json:"task_started"` TaskCompleted time.Time `json:"task_completed"` // time when task finished by worker TaskDuration time.Duration `json:"task_duration"` }
type TaskPostAction ¶
TaskPostAction is struct for handling post action after task is either scheduled or rejected based on the error
type TaskProgressResponse ¶
type TaskStatus ¶
type TaskStatus int
const ( TaskQueued TaskStatus = iota TaskStatusDone TaskStatusOnProgress TaskStatusFailed )
type TaskTranscodeType ¶
type TaskTranscodeType int
const ( TranscodeVideo TaskTranscodeType = iota TranscodeAudio )
type TranscodeTask ¶
type TranscodeTask struct { TranscodeType TaskTranscodeType `json:"transcode_type"` Video *Video `json:"video"` TargetRes string `gorm:"size:255;" json:"target_res"` TargetBitrate int `gorm:"size:255;" json:"target_bitrate"` TargetEncoding string `json:"target_encoding"` TargetReprCount int `json:"target_representation_count"` //Number of target representation ResultVideo *Video `json:"result_video"` ResultAudio *Audio `json:"result_audio"` }
type Video ¶
type Video struct { //gorm.Model, changed to mongodb Id primitive.ObjectID `bson:"_id,omitempty" json:"id"` FileName string `gorm:"size:255;not null;unique" json:"file_name"` Size int64 `json:"size,omitempty"` // File size in Byte Bitrate int `json:"bitrate"` Duration float32 `json:"duration"` Width int `json:"width"` Height int `json:"height"` Audio *Audio `json:"audio,omitempty"` Video []*Video `json:"video,omitempty"` //list of available video representation DashFile []string `json:"dash_file"` }
type Worker ¶
type Worker struct { Id primitive.ObjectID `bson:"id,omitempty" json:"id"` WorkerPodName string `json:"worker_pod_name"` IpAddress string `json:"ip_address"` Status WorkerStatus `json:"status"` WorkingOn string `json:"working_on"` // string of task id that worker working on UpdatedAt time.Time `json:"updated_at"` }
type WorkerStatus ¶
type WorkerStatus int
const ( WorkerStatusReady WorkerStatus = iota WorkerStatusWorking WorkerStatusTerminated WorkerStatusUnreachable )
Click to show internal directories.
Click to hide internal directories.