(body []byte)
| 108 | } |
| 109 | |
| 110 | func (mod *EventsStream) dumpJSON(body []byte) string { |
| 111 | var buf bytes.Buffer |
| 112 | var pretty string |
| 113 | |
| 114 | if err := json.Indent(&buf, body, "", " "); err != nil { |
| 115 | pretty = string(body) |
| 116 | } else { |
| 117 | pretty = buf.String() |
| 118 | } |
| 119 | |
| 120 | return "\n" + reJsonKey.ReplaceAllString(pretty, tui.Green(`$1:`)) + "\n" |
| 121 | } |
| 122 | |
| 123 | func (mod *EventsStream) dumpXML(body []byte) string { |
| 124 | // TODO: indent xml |
no test coverage detected