Browse Source
Add slug field to pipeline struct
feature/add-pipeline-endpoints
Fabian Vowie
3 years ago
No known key found for this signature in database
GPG Key ID: C27317C33B27C410
3 changed files with
21 additions and
16 deletions
-
pipeline.go
-
pipeline_test.go
-
pipelines/example.json
|
|
@ -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"` |
|
|
|
|
|
@ -1,8 +1,9 @@ |
|
|
|
package main |
|
|
|
|
|
|
|
import ( |
|
|
|
"github.com/stretchr/testify/assert" |
|
|
|
"testing" |
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert" |
|
|
|
) |
|
|
|
|
|
|
|
func TestImagePipelineDeserialization(t *testing.T) { |
|
|
|
|
|
@ -1,15 +1,18 @@ |
|
|
|
{ |
|
|
|
"name": "example pipeline", |
|
|
|
"type": 0, |
|
|
|
"removeMetadata": false, |
|
|
|
"steps": [ |
|
|
|
{ |
|
|
|
"name": "resize image", |
|
|
|
"type": 0 |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "compress image", |
|
|
|
"type": 1 |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
[ |
|
|
|
{ |
|
|
|
"name": "example pipeline", |
|
|
|
"slug": "example", |
|
|
|
"type": 0, |
|
|
|
"removeMetadata": false, |
|
|
|
"steps": [ |
|
|
|
{ |
|
|
|
"name": "resize image", |
|
|
|
"type": 0 |
|
|
|
}, |
|
|
|
{ |
|
|
|
"name": "compress image", |
|
|
|
"type": 1 |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
] |