diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-19 17:53:12 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-19 17:53:12 +0200 |
commit | 40f5d435e5f92abc8b64dae1c029f67d620db1f2 (patch) | |
tree | 51b66c873e3c371fbeeeb2b9c103ce83669a89ac /main.go | |
parent | 99c5ba31e854ae25e4990313096f818b7e0367da (diff) | |
download | feed2imap-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.go | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 } |