task

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VIDEO_CUT    = "video:cut"
	VIDEO_ENCODE = "video:encode"
	VIDEO_MERGE  = "video:merge"
)

task types, note that video: can get video:xxx:xxx format task type

View Source
const (
	TASK_STATUS_PENDING   = "pending"
	TASK_STATUS_RUNNING   = "running"
	TASK_STATUS_COMPLETED = "completed"
)

Variables

This section is empty.

Functions

func GetEncodeQueueName

func GetEncodeQueueName(name *string) string

GetEncodeQueueName 获取队列名称,如果没有则返回默认队列(低优先级)

func GetTaskTimeout

func GetTaskTimeout(num int, timeout *int) asynq.Option

GetTaskTimeout 获取任务超时时间,当不切割时为 48 小时,切割时默认为 20 分钟,可自定义

Types

type CutTaskPayload

type CutTaskPayload struct {
	VideoKey string `json:"video_key"`
	Slice    bool   `json:"slice"`
}

CutTaskPayload is a struct that represents the payload for cut task.

type EncodeTaskPayload

type EncodeTaskPayload struct {
	EncodeParam string           `json:"encode_param"`
	Script      string           `json:"script"`
	Clip        db.VideoClipInfo `json:"clip"`
	Retry       bool             `json:"retry"`
}

EncodeTaskPayload is a struct that represents the payload for encode task.

type MergeTaskPayload

type MergeTaskPayload struct {
	VideoKey string `json:"video_key"`
}

MergeTaskPayload is a struct that represents the payload for merge task.

Jump to

Keyboard shortcuts

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