-
Notifications
You must be signed in to change notification settings - Fork 18
/
options.go
155 lines (129 loc) · 2.66 KB
/
options.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
155
package allure
import (
"github.com/dailymotion/allure-go/severity"
)
type Option func(r hasOptions)
func ID(id string) Option {
return func(r hasOptions) {
r.addLabel("AS_ID", id)
}
}
func Lead(lead string) Option {
return func(r hasOptions) {
r.addLabel("lead", lead)
}
}
func Owner(owner string) Option {
return func(r hasOptions) {
r.addLabel("owner", owner)
}
}
func Epic(epic string) Option {
return func(r hasOptions) {
r.addLabel("epic", epic)
}
}
func Severity(severity severity.Severity) Option {
return func(r hasOptions) {
r.addLabel("severity", string(severity))
}
}
func Story(story string) Option {
return func(r hasOptions) {
r.addLabel("story", story)
}
}
func Feature(feature string) Option {
return func(r hasOptions) {
r.addLabel("feature", feature)
}
}
func Tag(tag string) Option {
return func(r hasOptions) {
r.addLabel("tag", tag)
}
}
func Tags(tags ...string) Option {
return func(r hasOptions) {
for _, tag := range tags {
r.addLabel("tag", tag)
}
}
}
func Parameter(name string, value interface{}) Option {
return func(r hasOptions) {
r.addParameter(name, value)
}
}
func Parameters(parameters map[string]interface{}) Option {
return func(r hasOptions) {
r.addParameters(parameters)
}
}
func Description(description string) Option {
return func(r hasOptions) {
r.addDescription(description)
}
}
func Action(action func()) Option {
return func(r hasOptions) {
r.addAction(action)
}
}
func Reason(reason string) Option {
return func(r hasOptions) {
r.addReason(reason)
}
}
func Name(name string) Option {
return func(r hasOptions) {
r.addName(name)
}
}
func Layer(layer string) Option {
return func(r hasOptions) {
r.addLabel("layer", layer)
}
}
func Link(url, name string) Option {
return func(r hasOptions) {
r.addLink(url, name, AnyLinkType)
}
}
func Issue(url, name string) Option {
return func(r hasOptions) {
r.addLink(url, name, IssueType)
}
}
func TestCase(url, name string) Option {
return func(r hasOptions) {
r.addLink(url, name, TestCaseType)
}
}
func Suite(suite string) Option {
return func(r hasOptions) {
r.addLabel("suite", suite)
}
}
func SubSuite(subSuite string) Option {
return func(r hasOptions) {
r.addLabel("subSuite", subSuite)
}
}
func ParentSuite(parentSuite string) Option {
return func(r hasOptions) {
r.addLabel("parentSuite", parentSuite)
}
}
func Label(labelName string, labelValue string) Option {
return func(r hasOptions) {
r.addLabel(labelName, labelValue)
}
}
func Labels(labelName string, labelValues ...string) Option {
return func(r hasOptions) {
for _, labelValue := range labelValues {
r.addLabel(labelName, labelValue)
}
}
}