(format string)
| 61 | ) |
| 62 | |
| 63 | func GetContainerFormat(format string) (ContainerFormat, error) { |
| 64 | switch format { |
| 65 | case "json", "jsonl", "": |
| 66 | return ContainerFormatJson, nil |
| 67 | |
| 68 | case "csv": |
| 69 | return ContainerFormatCSVAndJson, nil |
| 70 | |
| 71 | case "csv_only": |
| 72 | return ContainerFormatCSV, nil |
| 73 | |
| 74 | default: |
| 75 | } |
| 76 | return 0, fmt.Errorf( |
| 77 | "Unknown format parameter %v either 'json', 'jsonl', 'csv' or 'csv_only'.", |
| 78 | format) |
| 79 | } |
| 80 | |
| 81 | var ( |
| 82 | Clock utils.Clock = utils.RealClock{} |
no test coverage detected