String renders the mode for /config and logs.
()
| 51 | |
| 52 | // String renders the mode for /config and logs. |
| 53 | func (m Mode) String() string { |
| 54 | switch m { |
| 55 | case ModeOff: |
| 56 | return "off" |
| 57 | case ModeLosslessOnly: |
| 58 | return "lossless" |
| 59 | case ModeLossyWithCCR: |
| 60 | return "lossy-with-ccr" |
| 61 | default: |
| 62 | return "unknown" |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // ParseMode maps a config/env string to a Mode. Unknown values fall back to |
| 67 | // ModeLossyWithCCR (the recommended default) and report ok=false so callers |
no outgoing calls