package catalogue import ( "strings" ) // twoFiles is a module that owns two configurable files, which issue 168 said no module could: // every key of every layer reached both. func twoFiles(app, sidecar []any) Manifest { appFile := map[string]any{"id": "app", "type": "file", "path": "/etc/app.json", "merge": MergeJSON, "content": `{"server":{"port":8080},"search":{"safe":1}}`} sideFile := map[string]any{"id": "sidecar", "type": "file", "path": "/etc/sidecar.json", "merge": MergeJSON, "content": `{"url":"http://127.0.0.1:8080"}`} if app != nil { appFile[TakesSettingsField] = app } if sidecar != nil { sideFile[TakesSettingsField] = sidecar } return Manifest{Module: "search", Resources: []map[string]any{ appFile, sideFile, {"id": "env", "type": "file", "path": "/etc/search.env", "content": "SITE=${setting:site-name}\n"}, }} } func containsText(list []string, text string) bool { for _, s := range list { if strings.Contains(s, text) { return true } } return false }