Micro-service for file storage and processing written in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
667 B

package main
import "encoding/json"
type PipelineType int
type PipelineStepType int
const (
Image PipelineType = iota
Video
)
const (
Resize PipelineStepType = iota
Compress
Encode
)
type Pipeline struct {
Name string
Type PipelineType
RemoveMetadata bool
Steps []Step
}
type Step struct {
Name string
Type PipelineStepType
}
func DeserializePipelines(pipelines []string) []Pipeline {
values := make([]Pipeline, len(pipelines))
for index, pipeline := range pipelines {
var deserializedObject Pipeline
json.Unmarshal([]byte(pipeline), &deserializedObject)
values[index] = deserializedObject
}
return values
}