forked from dailymotion/allure-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.go
79 lines (65 loc) · 1.32 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
package allure
import (
"github.com/dailymotion/allure-go/severity"
)
type Option func(r hasOptions)
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 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)
}
}