Browse Source

Add slug field to pipeline struct

feature/add-pipeline-endpoints
Fabian Vowie 3 years ago
parent
commit
f6bb5498e8
No known key found for this signature in database GPG Key ID: C27317C33B27C410
  1. 1
      pipeline.go
  2. 3
      pipeline_test.go
  3. 33
      pipelines/example.json

1
pipeline.go

@ -27,6 +27,7 @@ type IPipeline interface {
type Pipeline struct { type Pipeline struct {
Name string `json:"name"` Name string `json:"name"`
Slug string `json:"slug"`
Type PipelineType `json:"type"` Type PipelineType `json:"type"`
RemoveMetadata bool `json:"remove_metadata"` RemoveMetadata bool `json:"remove_metadata"`
Steps []Step `json:"steps"` Steps []Step `json:"steps"`

3
pipeline_test.go

@ -1,8 +1,9 @@
package main package main
import ( import (
"github.com/stretchr/testify/assert"
"testing" "testing"
"github.com/stretchr/testify/assert"
) )
func TestImagePipelineDeserialization(t *testing.T) { func TestImagePipelineDeserialization(t *testing.T) {

33
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
}
]
}
[
{
"name": "example pipeline",
"slug": "example",
"type": 0,
"removeMetadata": false,
"steps": [
{
"name": "resize image",
"type": 0
},
{
"name": "compress image",
"type": 1
}
]
}
]
Loading…
Cancel
Save