Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteVideo(w http.ResponseWriter, r *http.Request)
- func FullUpdateVideo(w http.ResponseWriter, r *http.Request)
- func GetEnv(key string) string
- func GetVideo(w http.ResponseWriter, r *http.Request)
- func GetVideos(w http.ResponseWriter, r *http.Request)
- func HandleVideoEncodeTask(ctx context.Context, t *asynq.Task) error
- func HealthCheck(w http.ResponseWriter, r *http.Request)
- func NewVideoEncodeTask(uuid string, resX int, resY int) (*asynq.Task, error)
- func PartialUpdateVideo(w http.ResponseWriter, r *http.Request)
- func PostVideo(w http.ResponseWriter, r *http.Request)
- func SetStreamURL(v *Video, r *http.Request) error
- func StartServer()
- func StartTaskClient()
- func StartTaskServer()
- type Video
- type VideoEncodePayload
- type WebData
Constants ¶
View Source
const (
TypeVideoEncode = "video:encode"
)
A list of task types.
Variables ¶
View Source
var (
// ADDR = "localhost"
PORT = "5480"
)
Functions ¶
func DeleteVideo ¶
func DeleteVideo(w http.ResponseWriter, r *http.Request)
func FullUpdateVideo ¶
func FullUpdateVideo(w http.ResponseWriter, r *http.Request)
func HealthCheck ¶
func HealthCheck(w http.ResponseWriter, r *http.Request)
func NewVideoEncodeTask ¶
func PartialUpdateVideo ¶
func PartialUpdateVideo(w http.ResponseWriter, r *http.Request)
func SetStreamURL ¶
Set Video.StreamURL manually to generate URL.
func StartTaskServer ¶
func StartTaskServer()
Types ¶
type Video ¶
type Video struct { CreatedAt time.Time UpdatedAt time.Time // Manual primary key with uuid4 as value. ID string `gorm:"primaryKey"` // Video original filename after update. FileName string `json:"filename"` // Video title. Title string `json:"title"` // Video duration. Duration int `json:"duration"` // By default `false`, set as `true` when video is fully encoded. IsReady bool `json:"isReady"` // Dynamic field that will be filled with the stream url of th the video. StreamURL string `json:"streamURL"` }
Model
TODO: Use uuid instead of auto incremented uint
func (*Video) GetEncodedDestinationPath ¶
func (*Video) GetOriginalFilePath ¶
func (*Video) PrepareFolder ¶
Create a folder with the video UUID as name.
type VideoEncodePayload ¶
Click to show internal directories.
Click to hide internal directories.