fix: implement config-export hook
This will allow dropping many of the "source config/functions" calls littered over the codebase. Plugin triggers are the way to perform cross-plugin communication :)
This commit is contained in:
@@ -1,6 +1,23 @@
|
||||
package config
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// TriggerConfigExport returns a global config value by key
|
||||
func TriggerConfigExport(appName string, global string, merged string, format string) error {
|
||||
g, err := strconv.ParseBool(global)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
m, err := strconv.ParseBool(merged)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return export(appName, g, m, format)
|
||||
}
|
||||
|
||||
// TriggerConfigGet returns an app config value by key
|
||||
func TriggerConfigGet(appName string, key string) error {
|
||||
|
||||
Reference in New Issue
Block a user