exclude items from config when empty and rest options

This commit is contained in:
2021-04-23 13:11:15 +02:00
parent bacbd0f806
commit 188560395d
3 changed files with 50 additions and 23 deletions

View File

@@ -24,19 +24,19 @@ const (
type HookArray = []string
type Hooks struct {
Before HookArray `mapstructure:"before"`
After HookArray `mapstructure:"after"`
Before HookArray `yaml:"before"`
After HookArray `yaml:"after"`
}
type Options map[string]map[string][]string
type Location struct {
name string `mapstructure:",omitempty"`
From string `mapstructure:"from,omitempty"`
To []string `mapstructure:"to,omitempty"`
Hooks Hooks `mapstructure:"hooks,omitempty"`
Cron string `mapstructure:"cron,omitempty"`
Options Options `mapstructure:"options,omitempty"`
name string `yaml:",omitempty"`
From string `yaml:"from,omitempty"`
To []string `yaml:"to,omitempty"`
Hooks Hooks `yaml:"hooks,omitempty"`
Cron string `yaml:"cron,omitempty"`
Options Options `yaml:"options,omitempty"`
}
func GetLocation(name string) (Location, bool) {