-
Notifications
You must be signed in to change notification settings - Fork 3
/
json.go
154 lines (146 loc) · 3.9 KB
/
json.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
package cwl
import (
"encoding/json"
)
// A bunch of tedious wrappers for fields like "class" and "type"
// so that they marhshal to JSON/YAML correctly.
func (i File) MarshalJSON() ([]byte, error) {
type Wrap File
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"File", Wrap(i)})
}
func (i Directory) MarshalJSON() ([]byte, error) {
type Wrap Directory
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"Directory", Wrap(i)})
}
func (i InputArray) MarshalJSON() ([]byte, error) {
type Wrap InputArray
return json.Marshal(struct {
Type string `json:"type"`
Wrap
}{"array", Wrap(i)})
}
func (i OutputArray) MarshalJSON() ([]byte, error) {
type Wrap OutputArray
return json.Marshal(struct {
Type string `json:"type"`
Wrap
}{"array", Wrap(i)})
}
func (i InputRecord) MarshalJSON() ([]byte, error) {
type Wrap InputRecord
return json.Marshal(struct {
Type string `json:"type"`
Wrap
}{"record", Wrap(i)})
}
func (i OutputRecord) MarshalJSON() ([]byte, error) {
type Wrap OutputRecord
return json.Marshal(struct {
Type string `json:"type"`
Wrap
}{"record", Wrap(i)})
}
func (x Workflow) MarshalJSON() ([]byte, error) {
type Wrap Workflow
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"Workflow", Wrap(x)})
}
func (x Tool) MarshalJSON() ([]byte, error) {
type Wrap Tool
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"CommandLineTool", Wrap(x)})
}
func (x DockerRequirement) MarshalJSON() ([]byte, error) {
type Wrap DockerRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"DockerRequirement", Wrap(x)})
}
func (x ResourceRequirement) MarshalJSON() ([]byte, error) {
type Wrap ResourceRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"ResourceRequirement", Wrap(x)})
}
func (x EnvVarRequirement) MarshalJSON() ([]byte, error) {
type Wrap EnvVarRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"EnvVarRequirement", Wrap(x)})
}
func (x SchemaDefRequirement) MarshalJSON() ([]byte, error) {
type Wrap SchemaDefRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"SchemaDefRequirement", Wrap(x)})
}
func (x ShellCommandRequirement) MarshalJSON() ([]byte, error) {
type Wrap ShellCommandRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"ShellCommandRequirement", Wrap(x)})
}
func (x InlineJavascriptRequirement) MarshalJSON() ([]byte, error) {
type Wrap InlineJavascriptRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"InlineJavascriptRequirement", Wrap(x)})
}
func (x SoftwareRequirement) MarshalJSON() ([]byte, error) {
type Wrap SoftwareRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"SoftwareRequirement", Wrap(x)})
}
func (x InitialWorkDirRequirement) MarshalJSON() ([]byte, error) {
type Wrap InitialWorkDirRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"InitialWorkDirRequirement", Wrap(x)})
}
func (x SubworkflowFeatureRequirement) MarshalJSON() ([]byte, error) {
type Wrap SubworkflowFeatureRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"SubworkflowFeatureRequirement", Wrap(x)})
}
func (x ScatterFeatureRequirement) MarshalJSON() ([]byte, error) {
type Wrap ScatterFeatureRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"ScatterFeatureRequirement", Wrap(x)})
}
func (x MultipleInputFeatureRequirement) MarshalJSON() ([]byte, error) {
type Wrap MultipleInputFeatureRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"MultipleInputFeatureRequirement", Wrap(x)})
}
func (x StepInputExpressionRequirement) MarshalJSON() ([]byte, error) {
type Wrap StepInputExpressionRequirement
return json.Marshal(struct {
Class string `json:"class"`
Wrap
}{"StepInputExpressionRequirement", Wrap(x)})
}