aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-19 17:53:12 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-19 17:53:12 +0200
commit40f5d435e5f92abc8b64dae1c029f67d620db1f2 (patch)
tree51b66c873e3c371fbeeeb2b9c103ce83669a89ac /main.go
parent99c5ba31e854ae25e4990313096f818b7e0367da (diff)
downloadfeed2imap-go-40f5d435e5f92abc8b64dae1c029f67d620db1f2.tar.gz
feed2imap-go-40f5d435e5f92abc8b64dae1c029f67d620db1f2.tar.bz2
feed2imap-go-40f5d435e5f92abc8b64dae1c029f67d620db1f2.zip
Started IMAP connection
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.go b/main.go
index bbea985..f90cc50 100644
--- a/main.go
+++ b/main.go
@@ -2,9 +2,12 @@ package main
import (
"flag"
+ "fmt"
+ "net/url"
"os"
"github.com/Necoro/feed2imap-go/internal/config"
+ "github.com/Necoro/feed2imap-go/internal/imap"
"github.com/Necoro/feed2imap-go/internal/log"
"github.com/Necoro/feed2imap-go/internal/parse"
)
@@ -26,6 +29,18 @@ func run() error {
parse.Parse(cfg.Feeds)
+ imapUrl, err := url.Parse(cfg.GlobalConfig["target"].(string))
+ if err != nil {
+ return fmt.Errorf("parsing 'target': %w", err)
+ }
+
+ c, err := imap.Connect(imapUrl)
+ if err != nil {
+ return err
+ }
+
+ defer c.Disconnect()
+
return nil
}