aboutsummaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-20 02:02:15 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-20 02:02:15 +0200
commit9e45db27daa3b682c4d8e1e1aa9e66594cf887a4 (patch)
tree251177708d11f7118541fc49ac1549df18803ad7 /internal/config
parentf1231aa444bd13aa031fe6e3dac32138436f956b (diff)
downloadfeed2imap-go-9e45db27daa3b682c4d8e1e1aa9e66594cf887a4.tar.gz
feed2imap-go-9e45db27daa3b682c4d8e1e1aa9e66594cf887a4.tar.bz2
feed2imap-go-9e45db27daa3b682c4d8e1e1aa9e66594cf887a4.zip
Started with mail creation
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go28
1 files changed, 25 insertions, 3 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 6497ce1..a37cef1 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -10,15 +10,17 @@ import (
type Map map[string]interface{}
type GlobalOptions struct {
- Timeout int `yaml:"timeout"`
- DefaultEmail string `yaml:"default-email"`
- Target string `yaml:"target"`
+ Timeout int `yaml:"timeout"`
+ DefaultEmail string `yaml:"default-email"`
+ Target string `yaml:"target"`
+ Parts []string `yaml:"parts"`
}
var DefaultGlobalOptions = GlobalOptions{
Timeout: 30,
DefaultEmail: username() + "@" + hostname(),
Target: "",
+ Parts: []string{"text", "html"},
}
type Config struct {
@@ -31,6 +33,26 @@ type Options struct {
InclImages *bool `yaml:"include-images"`
}
+func (c *Config) WithPartText() bool {
+ for _, part := range c.Parts {
+ if part == "text" {
+ return true
+ }
+ }
+
+ return false
+}
+
+func (c *Config) WithPartHtml() bool {
+ for _, part := range c.Parts {
+ if part == "html" {
+ return true
+ }
+ }
+
+ return false
+}
+
func hostname() (hostname string) {
hostname, err := os.Hostname()
if err != nil {