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

  1. package main
  2. import "encoding/json"
  3. type PipelineType int
  4. type PipelineStepType int
  5. const (
  6. Image PipelineType = iota
  7. Video
  8. )
  9. const (
  10. Resize PipelineStepType = iota
  11. Compress
  12. Encode
  13. )
  14. type Pipeline struct {
  15. Name string
  16. Type PipelineType
  17. RemoveMetadata bool
  18. Steps []Step
  19. }
  20. type Step struct {
  21. Name string
  22. Type PipelineStepType
  23. }
  24. func DeserializePipelines(pipelines []string) []Pipeline {
  25. values := make([]Pipeline, len(pipelines))
  26. for index, pipeline := range pipelines {
  27. var deserializedObject Pipeline
  28. json.Unmarshal([]byte(pipeline), &deserializedObject)
  29. values[index] = deserializedObject
  30. }
  31. return values
  32. }