summaryrefslogtreecommitdiff
path: root/plugins/config/plugin.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-03-31 18:58:03 +0300
committerValery Piashchynski <[email protected]>2021-03-31 18:58:03 +0300
commit955c6b7ca530172acc646c55e7e3eda04f543310 (patch)
treea816de47e7a1e5d6cabe836a30c7552e6023c3d2 /plugins/config/plugin.go
parentae6d488c9da200203c78af23518ea4f2f2e96773 (diff)
- Config: Add the ability to pass General config options to any plugin
Diffstat (limited to 'plugins/config/plugin.go')
-rwxr-xr-xplugins/config/plugin.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/config/plugin.go b/plugins/config/plugin.go
index a01a32b3..09fd35bb 100755
--- a/plugins/config/plugin.go
+++ b/plugins/config/plugin.go
@@ -19,6 +19,8 @@ type Viper struct {
// user defined Flags in the form of <option>.<key> = <value>
// which overwrites initial config key
Flags []string
+
+ CommonConfig *General
}
// Inits config provider.
@@ -111,6 +113,11 @@ func (v *Viper) Has(name string) bool {
return v.viper.IsSet(name)
}
+// Returns common config parameters
+func (v *Viper) GetCommonConfig() *General {
+ return v.CommonConfig
+}
+
func parseFlag(flag string) (string, string, error) {
const op = errors.Op("parse_flag")
if !strings.Contains(flag, "=") {