diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-05-11 01:32:45 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-05-11 01:32:45 +0200 |
commit | 1031949a98b8c43ec9fc99f8f23240e8644f5e6b (patch) | |
tree | 7f813e4ed90d7f236008db20ad17ba2e6dcc2739 /pkg/config | |
parent | 4fb2a3ff9cb8f1acbc19ab6da4043cabec7eec99 (diff) | |
download | feed2imap-go-1031949a98b8c43ec9fc99f8f23240e8644f5e6b.tar.gz feed2imap-go-1031949a98b8c43ec9fc99f8f23240e8644f5e6b.tar.bz2 feed2imap-go-1031949a98b8c43ec9fc99f8f23240e8644f5e6b.zip |
Fix comments
Diffstat (limited to 'pkg/config')
-rw-r--r-- | pkg/config/config.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go index bfaefdf..231ce9e 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -11,11 +11,11 @@ import ( "github.com/Necoro/feed2imap-go/pkg/util" ) -// Convenience type for the non-mapped configuration options +// Map is a convenience type for the non-mapped configuration options // Mostly used for legacy options type Map map[string]interface{} -// Global options, not feed specific +// GlobalOptions are not feed specific type GlobalOptions struct { Timeout int `yaml:"timeout"` DefaultEmail string `yaml:"default-email"` @@ -25,7 +25,6 @@ type GlobalOptions struct { AutoTarget bool `yaml:"auto-target"` } -// Default global options var DefaultGlobalOptions = GlobalOptions{ Timeout: 30, MaxFailures: 10, @@ -35,7 +34,7 @@ var DefaultGlobalOptions = GlobalOptions{ AutoTarget: true, } -// Per feed options +// Options are feed specific // NB: Always specify a yaml name, as it is later used in processing type Options struct { MinFreq int `yaml:"min-frequency"` @@ -50,7 +49,6 @@ type Options struct { Body Body `yaml:"body"` } -// Default feed options var DefaultFeedOptions = Options{ Body: "default", MinFreq: 0, @@ -79,7 +77,7 @@ func WithDefault() *Config { } } -// Validates the configuration against common mistakes +// Validate checks the configuration against common mistakes func (cfg *Config) Validate() error { if cfg.Target.Empty() { return fmt.Errorf("No target set!") @@ -94,12 +92,12 @@ func (cfg *Config) Validate() error { return nil } -// Marks whether 'text' part should be included in mails +// WithPartText marks whether 'text' part should be included in mails func (opt GlobalOptions) WithPartText() bool { return util.StrContains(opt.Parts, "text") } -// Marks whether 'html' part should be included in mails +// WithPartHtml marks whether 'html' part should be included in mails func (opt GlobalOptions) WithPartHtml() bool { return util.StrContains(opt.Parts, "html") } |