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 }