String colorized service status message.
()
| 73 | |
| 74 | // String colorized service status message. |
| 75 | func (u configGetMessage) String() string { |
| 76 | console.SetColor("EnvVar", color.New(color.FgYellow)) |
| 77 | bio := bufio.NewReader(bytes.NewReader(u.value)) |
| 78 | var lines []string |
| 79 | for { |
| 80 | s, e := bio.ReadString('\n') |
| 81 | // Make lines displaying environment variables bold. |
| 82 | if strings.HasPrefix(s, "# MINIO_") { |
| 83 | s = strings.TrimPrefix(s, "# ") |
| 84 | parts := strings.SplitN(s, "=", 2) |
| 85 | s = fmt.Sprintf("# %s=%s", console.Colorize("EnvVar", parts[0]), parts[1]) |
| 86 | lines = append(lines, s) |
| 87 | } else { |
| 88 | lines = append(lines, s) |
| 89 | } |
| 90 | if e == io.EOF { |
| 91 | break |
| 92 | } |
| 93 | fatalIf(probe.NewError(e), "Unable to marshal to string.") |
| 94 | } |
| 95 | return strings.Join(lines, "") |
| 96 | } |
| 97 | |
| 98 | // JSON jsonified service status Message message. |
| 99 | func (u configGetMessage) JSON() string { |