-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththumb_process.go
More file actions
43 lines (36 loc) · 1000 Bytes
/
thumb_process.go
File metadata and controls
43 lines (36 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package entity
import "github.com/google/uuid"
const (
ThumbProcessStatusPending string = "pending"
ThumbProcessStatusComplete string = "complete"
ThumbProcessStatusFailed string = "failed"
)
var AllowedProcessStatus = map[string]bool{
ThumbProcessStatusPending: true,
ThumbProcessStatusComplete: true,
ThumbProcessStatusFailed: true,
}
type ThumbProcess struct {
ID uuid.UUID `json:"id"`
UserEmail string `json:"user_email"`
Video ThumbProcessVideo `json:"video"`
Status string `json:"status"`
Error string `json:"error,omitempty"`
Thumbnail ThumbProcessThumb `json:"thumbnail"`
}
type ThumbProcessVideo struct {
Path string `json:"path"`
}
type ThumbProcessThumb struct {
Path string `json:"url"`
}
func NewThumbProcess(url, email string) *ThumbProcess {
return &ThumbProcess{
ID: uuid.New(),
UserEmail: email,
Video: ThumbProcessVideo{
Path: url,
},
Status: ThumbProcessStatusPending,
}
}