aboutsummaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/config.go b/config.go
index f965c24..1ec7207 100644
--- a/config.go
+++ b/config.go
@@ -5,6 +5,7 @@ import (
"os"
"sync"
+ "go.lindenii.runxiyu.org/lindenii-common/misc"
"go.lindenii.runxiyu.org/lindenii-common/scfg"
)
@@ -33,3 +34,19 @@ func load_config(path string) error {
}
return nil
}
+
+var directories struct {
+ inbox misc.Dir_t
+}
+var directories_mutex sync.RWMutex
+
+func prepare_dirs() error {
+ directories_mutex.Lock()
+ defer directories_mutex.Unlock()
+ var err error
+ directories.inbox, err = misc.Open_directory_readonly(config.Inbox_path)
+ if err != nil {
+ return err
+ }
+ return nil
+}