(ctx context.Context, zw *zip.Writer, db *database.Client)
| 326 | } |
| 327 | |
| 328 | func (cli *cliSupport) dumpPAPIStatus(ctx context.Context, zw *zip.Writer, db *database.Client) error { |
| 329 | fmt.Fprintln(os.Stdout, "Collecting PAPI status") |
| 330 | |
| 331 | out := new(bytes.Buffer) |
| 332 | cp := clipapi.New(cli.cfg) |
| 333 | |
| 334 | err := cp.Status(ctx, out, db) |
| 335 | if err != nil { |
| 336 | fmt.Fprintf(out, "%s\n", err) |
| 337 | } |
| 338 | |
| 339 | stripped := stripAnsiString(out.String()) |
| 340 | |
| 341 | cli.writeToZip(zw, SUPPORT_PAPI_STATUS_PATH, time.Now(), strings.NewReader(stripped)) |
| 342 | |
| 343 | return nil |
| 344 | } |
| 345 | |
| 346 | func (cli *cliSupport) dumpConfigYAML(zw *zip.Writer) error { |
| 347 | fmt.Fprintln(os.Stdout, "Collecting crowdsec config") |
no test coverage detected