-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.go
31 lines (26 loc) · 815 Bytes
/
config.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
package goseeder
//ConfigOption option to configure the seeder
type ConfigOption = func(config *config)
type config struct {
env string
seedMethodNames []string
skipCommon bool
}
//ForEnv specify the env for which the seeders run for
func ForEnv(env string) ConfigOption {
return func(config *config) {
config.env = env
}
}
//ForSpecificSeeds array of seed names you want to specify for execution
func ForSpecificSeeds(seedNames []string) ConfigOption {
return func(config *config) {
config.seedMethodNames = seedNames
}
}
//ShouldSkipCommon this option has effect only if also gsenv if set, then will not run the common seeds (seeds that do not have any env specified
func ShouldSkipCommon(value bool) ConfigOption {
return func(config *config) {
config.skipCommon = value
}
}