aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config/config.go')
-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 {