MCPcopy Create free account
hub / github.com/AdRoll/baker / genOutputText

Function genOutputText

help_text.go:101–127  ·  view source on GitHub ↗
(w io.Writer, doc outputDoc)

Source from the content-addressed store, hash-verified

99}
100
101func genOutputText(w io.Writer, doc outputDoc) {
102 const (
103 rawString = "This is a raw output, for each record it receives a buffer containing the serialized record, plus a list holding a set of fields ('output.fields' in TOML)."
104 nonRawString = "This is a non-raw output, it doesn't receive whole records. Instead it receives a list of fields for each record ('output.fields' in TOML)."
105 )
106
107 fmt.Fprintf(w, "=============================================\n")
108 fmt.Fprintf(w, "Output: %s\n", doc.name)
109 fmt.Fprintf(w, "=============================================\n")
110 fmt.Fprintf(w, doc.help)
111
112 if doc.raw {
113 fmt.Fprintln(w, rawString)
114 } else {
115 fmt.Fprintln(w, nonRawString)
116 }
117
118 if len(doc.keys) == 0 {
119 fmt.Fprintf(w, "\n(no configuration available)\n\n")
120 } else {
121 fmt.Fprintf(w, "\nKeys available in the [output.config] section:\n\n")
122 genConfigKeysText(w, doc.keys)
123 }
124
125 fmt.Fprintln(w)
126 fmt.Fprintln(w)
127}
128
129func genUploadText(w io.Writer, doc uploadDoc) {
130 fmt.Fprintf(w, "=============================================\n")

Callers 1

GenerateTextHelpFunction · 0.85

Calls 1

genConfigKeysTextFunction · 0.85

Tested by

no test coverage detected