From 1031949a98b8c43ec9fc99f8f23240e8644f5e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 11 May 2021 01:32:45 +0200 Subject: Fix comments --- pkg/config/config.go | 14 ++++++-------- 1 file 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") } -- cgit v1.2.3