-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from kristijorgji/v1.0.2
allow custom named seeds, make it possible for programmatic usage lik…
- Loading branch information
Showing
6 changed files
with
224 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters