manager_report.go
raw| 1 | package proton |
| 2 | |
| 3 | import ( |
| 4 | "bytes" |
| 5 | "context" |
| 6 | ) |
| 7 | |
| 8 | func (m *Manager) ReportBug(ctx context.Context, req ReportBugReq, atts ...ReportBugAttachment) error { |
| 9 | r := m.r(ctx).SetMultipartFormData(req.toFormData()) |
| 10 | |
| 11 | for _, att := range atts { |
| 12 | r = r.SetMultipartField(att.Name, att.Filename, string(att.MIMEType), bytes.NewReader(att.Body)) |
| 13 | } |
| 14 | |
| 15 | if _, err := r.Post("/core/v4/reports/bug"); err != nil { |
| 16 | return err |
| 17 | } |
| 18 | |
| 19 | return nil |
| 20 | } |