aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/importer/importer.go')
-rw-r--r--pkg/importer/importer.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkg/importer/importer.go b/pkg/importer/importer.go
new file mode 100644
index 0000000..a989238
--- /dev/null
+++ b/pkg/importer/importer.go
@@ -0,0 +1,24 @@
+package importer
+
+import (
+ "archives/pkg/config"
+ "log"
+ "os"
+ "path/filepath"
+)
+
+func FullImport() {
+ err := filepath.Walk(config.MailDirPath(),
+ func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ return err
+ }
+ if !info.IsDir() && getDepth(path, config.MailDirPath()) >= 1 {
+ importMail(info.Name(), path, config.MailDirPath())
+ }
+ return nil
+ })
+ if err != nil {
+ log.Println(err)
+ }
+}