summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'init.go')
-rw-r--r--init.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/init.go b/init.go
index f87bbb5..19a828b 100644
--- a/init.go
+++ b/init.go
@@ -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)
+}