add missing comments

This commit is contained in:
David Christofas
2023-03-06 17:38:47 +01:00
parent dd4cc1bd42
commit 924c2ca346
29 changed files with 115 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/owncloud/ocis/v2/services/sharing/pkg/config"
)
// FullDefaultConfig returns a fully initialized default configuration
func FullDefaultConfig() *config.Config {
cfg := DefaultConfig()
EnsureDefaults(cfg)
@@ -16,6 +17,7 @@ func FullDefaultConfig() *config.Config {
return cfg
}
// DefaultConfig returns a basic default configuration
func DefaultConfig() *config.Config {
return &config.Config{
Debug: config.Debug{
@@ -76,14 +78,14 @@ func DefaultConfig() *config.Config {
}
}
// EnsureDefaults adds default values to the configuration if they are not set yet
func EnsureDefaults(cfg *config.Config) {
// provide with defaults for shared logging, since we need a valid destination address for "envdecode".
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
cfg.Log = &config.Log{
Level: cfg.Commons.Log.Level,
Pretty: cfg.Commons.Log.Pretty,
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
Pretty: cfg.Commons.Log.Pretty, Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil {
cfg.Log = &config.Log{}
@@ -149,6 +151,7 @@ func EnsureDefaults(cfg *config.Config) {
}
}
// Sanitize sanitized the configuration
func Sanitize(cfg *config.Config) {
// nothing to sanitize here atm
}