Skip to content

Commit

Permalink
adding json serialization to all classes
Browse files Browse the repository at this point in the history
Signed-off-by: Khash Sajadi <khash@cloud66.com>
  • Loading branch information
khash committed Apr 26, 2019
1 parent d39e44f commit a8349e6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions utils/preflight.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (

// Preflight is a check that runs at the beginning of the workflow
type Preflight struct {
Command string `yaml:"command"`
Message string `yaml:"message"`
Workdir string `yaml:"workdir"`
Timeout *time.Duration `yaml:"timeout"`
Command string `yaml:"command" json:"command"`
Message string `yaml:"message" json:"message"`
Workdir string `yaml:"workdir" json:"workdir"`
Timeout *time.Duration `yaml:"timeout" json:"timeout"`

step *Step
}
Expand Down
4 changes: 2 additions & 2 deletions utils/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package utils

// Probe defines a checker for a Step's health
type Probe struct {
Command string `yaml:"command"`
Workdir string `yaml:"workdir"`
Command string `yaml:"command" json:"command"`
Workdir string `yaml:"workdir" json:"workdir"`

cmd string
args []string
Expand Down
18 changes: 9 additions & 9 deletions utils/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ type StepOptions struct {

// Step is a single running Step
type Step struct {
Metadata map[string]string `yaml:"metadata"`
Name string `yaml:"name"`
Command string `yaml:"command"`
ContinueOnFail bool `yaml:"continue_on_fail"`
Timeout *time.Duration `yaml:"timeout"`
Workdir string `yaml:"workdir"`
Probe *Probe `yaml:"probe"`
DependsOn []string `yaml:"depends_on"`
Preflights []Preflight `yaml:"preflights"`
Metadata map[string]string `yaml:"metadata" json:"metadata"`
Name string `yaml:"name" json:"name"`
Command string `yaml:"command" json:"command"`
ContinueOnFail bool `yaml:"continue_on_fail" json:"continue_on_fail"`
Timeout *time.Duration `yaml:"timeout" json:"timeout"`
Workdir string `yaml:"workdir" json:"workdir"`
Probe *Probe `yaml:"probe" json:"probe"`
DependsOn []string `yaml:"depends_on" json:"depends_on"`
Preflights []Preflight `yaml:"preflights" json:"preflights"`

options *StepOptions
workflow *Workflow
Expand Down
6 changes: 3 additions & 3 deletions utils/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ type WorkflowOptions struct {

// Workflow is the internal object to hold a workflow file
type Workflow struct {
Version string
Metadata map[string]string
Steps []*Step
Version string `yaml:"version" json:"version"`
Metadata map[string]string `yaml:"metadata" json:"metadata"`
Steps []*Step `yaml:"steps" json:"steps"`

options *WorkflowOptions
logger *logrus.Logger
Expand Down

0 comments on commit a8349e6

Please sign in to comment.