MCPcopy Create free account
hub / github.com/Unpackerr/unpackerr / createCompose

Function createCompose

init/config/compose.go:41–62  ·  view source on GitHub ↗
(config *Config, output, dir string)

Source from the content-addressed store, hash-verified

39)
40
41func createCompose(config *Config, output, dir string) {
42 buf := bytes.Buffer{}
43 buf.WriteString(composeHeader + "\n")
44
45 // Loop the 'Order' list.
46 for _, section := range config.Order {
47 // If Order contains a missing section, bail.
48 if config.Sections[section] == nil {
49 log.Fatalln(section + ": in order, but missing from sections. This is a bug in definitions.yml.")
50 }
51
52 if config.Defs[section] == nil {
53 buf.WriteString(config.Sections[section].makeCompose(config.Prefix, false))
54 } else {
55 buf.WriteString(config.Sections[section].
56 makeComposeDefined(config.Prefix, config.Defs[section], config.DefOrder[section], false))
57 }
58 }
59
60 buf.WriteString("\n")
61 writeFile(dir, output, &buf)
62}
63
64func (h *Header) makeCompose(prefix string, bare bool) string {
65 var buf bytes.Buffer

Callers 1

mainFunction · 0.85

Calls 3

writeFileFunction · 0.85
makeComposeMethod · 0.80
makeComposeDefinedMethod · 0.80

Tested by

no test coverage detected