diff options
| author | Jeff Carr <[email protected]> | 2025-02-08 06:35:38 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-08 06:35:38 -0600 |
| commit | cbaa1c37132e73d4fd112418a7544ae71b46dfe0 (patch) | |
| tree | 9beb21edf36124dcbaf5903f61a5bdd14866abbd /init.go | |
| parent | cb76668f8e404fb9094cf7f30da5ccf971c82e0e (diff) | |
make a config filev0.22.7
Diffstat (limited to 'init.go')
| -rw-r--r-- | init.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -5,6 +5,7 @@ package tree import ( + "fmt" "os" "runtime/debug" "sync" @@ -109,9 +110,25 @@ func (me *TreeInfo) catchActionChannel() { func New() *TreeInfo { me := new(TreeInfo) me.pluginChan = make(chan widget.Action, 1) + me.config = configLoad() log.Log(TREE, "Init() start channel reciever") go me.catchActionChannel() log.Log(TREE, "Init() END") return me } + +func (t *TreeInfo) ConfigFind(n string) (string, error) { + all := t.config.All() // get the list of repos + for all.Scan() { + r := all.Next() + if t.PluginName != r.Plugin { + continue + } + if n == r.Name { + return r.Value, nil + } + log.Info("toolkit config", r.Plugin, r.Name, r.Value, n) + } + return "", fmt.Errorf("toolkit config %s not found", n) +} |
