-
Notifications
You must be signed in to change notification settings - Fork 18
/
options.go
52 lines (43 loc) · 1.19 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
package executor
import (
"github.com/cirruslabs/cirrus-cli/internal/executor/instance/containerbackend"
"github.com/cirruslabs/cirrus-cli/internal/executor/options"
"github.com/cirruslabs/cirrus-cli/internal/executor/taskfilter"
"github.com/cirruslabs/echelon"
)
type Option func(*Executor)
func WithLogger(logger *echelon.Logger) Option {
return func(e *Executor) {
e.logger = logger
}
}
func WithTaskFilter(taskFilter taskfilter.TaskFilter) Option {
return func(e *Executor) {
e.taskFilter = taskFilter
}
}
func WithBaseEnvironmentOverride(environment map[string]string) Option {
return func(e *Executor) {
e.baseEnvironment = environment
}
}
func WithUserSpecifiedEnvironment(environment map[string]string) Option {
return func(e *Executor) {
e.userSpecifiedEnvironment = environment
}
}
func WithDirtyMode() Option {
return func(e *Executor) {
e.dirtyMode = true
}
}
func WithContainerOptions(containerOptions options.ContainerOptions) Option {
return func(e *Executor) {
e.containerOptions = containerOptions
}
}
func WithContainerBackend(containerBackend containerbackend.ContainerBackend) Option {
return func(e *Executor) {
e.containerBackend = containerBackend
}
}