aboutsummaryrefslogtreecommitdiff
path: root/pkg/config
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-05-11 01:32:45 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-05-11 01:32:45 +0200
commit1031949a98b8c43ec9fc99f8f23240e8644f5e6b (patch)
tree7f813e4ed90d7f236008db20ad17ba2e6dcc2739 /pkg/config
parent4fb2a3ff9cb8f1acbc19ab6da4043cabec7eec99 (diff)
downloadfeed2imap-go-1031949a98b8c43ec9fc99f8f23240e8644f5e6b.tar.gz
feed2imap-go-1031949a98b8c43ec9fc99f8f23240e8644f5e6b.tar.bz2
feed2imap-go-1031949a98b8c43ec9fc99f8f23240e8644f5e6b.zip
Fix comments
Diffstat (limited to '')
-rw-r--r--pkg/config/config.go14
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")
}
'/others/cgit.git/commit/cgitrc.5.txt?h=v0.9.0.2&id=f618e8f7174011e1e793df2c67fb9d1341652054&follow=1'>cgitrc.5.txt: document 'head-include'Lars Hjemli1-0/+4 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25ui-blob: return 'application/octet-stream' for binary blobsLars Hjemli1-1/+7 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-07-25ui-plain: Return 'application/octet-stream' for binary files.Remko Tronçon1-1/+4 Signed-off-by: Remko Tronçon <git@el-tramo.be> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-06-11use cgit_httpscheme() for atom feedDiego Ongaro2-3/+6 2009-06-11add cgit_httpscheme() -> http:// or https://Diego Ongaro2-0/+12 2009-06-07Return http statuscode 404 on unknown branchLars Hjemli3-0/+6 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-06-07Add head-include configuration option.Mark Lodato3-1/+6 This patch adds an option to the configuration file, "head-include", which works just like "header" or "footer", except the content is put into the HTML's <head> tag. 2009-03-15CGIT 0.8.2.1v0.8.2.1Lars Hjemli1-1/+1 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli2-1/+6 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli1-6/+17 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-03-15fix segfault when displaying empty blobsEric Wong1-5/+8 When size is zero, subtracting one from it turns it into ULONG_MAX which causes an out-of-bounds access on buf. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-02-19Add support for HEAD requestsLars Hjemli2-0/+7 This is a quick 'n dirty hack which makes cgit honor HEAD requests. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-02-19Add support for ETag in 'plain' viewLars Hjemli4-0/+5 When downloading a blob identified by its path, the client might want to know if the blob has been modified since a previous download of the same path. To this end, an ETag containing the blob SHA1 seems to be ideal. Todo: add support for HEAD requests... Suggested-by: Owen Taylor <otaylor@redhat.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli1-4/+9 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2009-02-12Makefile: add doc-related targetsLars Hjemli1-2/+17 Signed-off-by: Lars Hjemli <hjemli@gmail.com>