MCPcopy Create free account
hub / github.com/opencloud-eu/opencloud / Validate

Function Validate

services/postprocessing/pkg/config/parser/parse.go:39–51  ·  view source on GitHub ↗

Validate validates the config

(cfg *config.Config)

Source from the content-addressed store, hash-verified

37
38// Validate validates the config
39func Validate(cfg *config.Config) error {
40 if cfg.Postprocessing.Delayprocessing != 0 {
41 if !contains(cfg.Postprocessing.Steps, events.PPStepDelay) {
42 if len(cfg.Postprocessing.Steps) > 0 {
43 s := strings.Join(append(cfg.Postprocessing.Steps, string(events.PPStepDelay)), ",")
44 fmt.Printf("Added delay step to the list of postprocessing steps. NOTE: Use envvar `POSTPROCESSING_STEPS=%s` to suppress this message and choose the order of postprocessing steps.\n", s)
45 }
46
47 cfg.Postprocessing.Steps = append(cfg.Postprocessing.Steps, string(events.PPStepDelay))
48 }
49 }
50 return nil
51}
52
53func contains(all []string, candidate events.Postprocessingstep) bool {
54 for _, s := range all {

Callers 1

ParseConfigFunction · 0.70

Calls 1

containsFunction · 0.85

Tested by

no test coverage detected