From f6bb5498e814053827a3cf2e37b200d5e1a2df3f Mon Sep 17 00:00:00 2001 From: Fabian Vowie Date: Sat, 15 Jan 2022 11:51:20 +0100 Subject: [PATCH] Add slug field to pipeline struct --- pipeline.go | 1 + pipeline_test.go | 3 ++- pipelines/example.json | 33 ++++++++++++++++++--------------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/pipeline.go b/pipeline.go index 0fd1ca3..4ea3e9a 100644 --- a/pipeline.go +++ b/pipeline.go @@ -27,6 +27,7 @@ type IPipeline interface { type Pipeline struct { Name string `json:"name"` + Slug string `json:"slug"` Type PipelineType `json:"type"` RemoveMetadata bool `json:"remove_metadata"` Steps []Step `json:"steps"` diff --git a/pipeline_test.go b/pipeline_test.go index 38c16e6..0c91123 100644 --- a/pipeline_test.go +++ b/pipeline_test.go @@ -1,8 +1,9 @@ package main import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestImagePipelineDeserialization(t *testing.T) { diff --git a/pipelines/example.json b/pipelines/example.json index bc42609..3cb6290 100644 --- a/pipelines/example.json +++ b/pipelines/example.json @@ -1,15 +1,18 @@ -{ - "name": "example pipeline", - "type": 0, - "removeMetadata": false, - "steps": [ - { - "name": "resize image", - "type": 0 - }, - { - "name": "compress image", - "type": 1 - } - ] -} \ No newline at end of file +[ + { + "name": "example pipeline", + "slug": "example", + "type": 0, + "removeMetadata": false, + "steps": [ + { + "name": "resize image", + "type": 0 + }, + { + "name": "compress image", + "type": 1 + } + ] + } +] \ No newline at end of file