forked from hybrik/hybrik-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
job_models.go
126 lines (106 loc) · 3.55 KB
/
job_models.go
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
package hybrik
// CreateJob .
type CreateJob struct {
Name string `json:"name"`
Payload CreateJobPayload `json:"payload"`
Schema string `json:"schema,omitempty"`
Expiration int `json:"expiration,omitempty"`
Priority int `json:"priority,omitempty"`
TaskRetryCount int `json:"task_retry:count,omitempty"`
TaskRetryDelaySec int `json:"task_retry:delay_sec,omitempty"`
TaskTags []string `json:"task_tags,omitempty"`
UserTag string `json:"user_tag,omitempty"`
}
// CreateJobPayload .
type CreateJobPayload struct {
Elements []Element `json:"elements,omitempty"`
Connections []Connection `json:"connections,omitempty"`
}
// Element .
type Element struct {
UID string `json:"uid"`
Kind string `json:"kind"`
Task *ElementTaskOptions `json:"task,omitempty"`
Preset *TranscodePreset `json:"preset,omitempty"`
Payload interface{} `json:"payload"` // Can be of type ElementPayload or LocationTargetPayload
}
// ElementTaskOptions .
type ElementTaskOptions struct {
Name string `json:"name"`
}
// ElementPayload .
type ElementPayload struct {
Kind string `json:"kind,omitempty"`
Payload AssetPayload `json:"payload"`
}
// ManifestCreatorPayload .
type ManifestCreatorPayload struct {
Location TranscodeLocation `json:"location"`
FilePattern string `json:"file_pattern"`
Kind string `json:"kind"`
UID string `json:"uid,omitempty"`
}
// LocationTargetPayload .
type LocationTargetPayload struct {
Location TranscodeLocation `json:"location"`
Targets []TranscodeLocationTarget `json:"targets"`
}
// TranscodePreset .
type TranscodePreset struct {
Key string `json:"key"`
}
// TranscodeLocationTarget .
type TranscodeLocationTarget struct {
FilePattern string `json:"file_pattern"`
ExistingFiles string `json:"existing_files,omitempty"`
Container TranscodeTargetContainer `json:"container,omitempty"`
Location *TranscodeLocation `json:"location,omitempty"`
}
// TranscodeTargetContainer .
type TranscodeTargetContainer struct {
SegmentDuration uint `json:"segment_duration,omitempty"`
}
// AssetPayload .
type AssetPayload struct {
StorageProvider string `json:"storage_provider,omitempty"`
URL string `json:"url,omitempty"`
}
// TranscodeLocation .
type TranscodeLocation struct {
StorageProvider string `json:"storage_provider,omitempty"`
Path string `json:"path,omitempty"`
}
//TranscodeTarget .
type TranscodeTarget struct {
FilePattern string `json:"file_pattern"`
ExistingFiles string `json:"existing_files"`
Container TranscodeContainer `json:"container"`
Video map[string]interface{} `json:"video"`
Audio []map[string]interface{} `json:"audio"`
}
// TranscodeContainer .
type TranscodeContainer struct {
Kind string `json:"kind"`
}
// Connection .
type Connection struct {
From []ConnectionFrom `json:"from,omitempty"`
To ConnectionTo `json:"to,omitempty"`
}
// ConnectionFrom .
type ConnectionFrom struct {
Element string `json:"element,omitempty"`
}
// ConnectionTo .
type ConnectionTo struct {
Success []ToSuccess `json:"success,omitempty"`
Error []ToError `json:"error,omitempty"`
}
// ToSuccess .
type ToSuccess struct {
Element string `json:"element,omitempty"`
}
// ToError .
type ToError struct {
Element string `json:"element,omitempty"`
}