File: manager_report.go

package info (click to toggle)
golang-github-henrybear327-go-proton-api 1.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,088 kB
  • sloc: sh: 55; makefile: 26
file content (20 lines) | stat: -rw-r--r-- 428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package proton

import (
	"bytes"
	"context"
)

func (m *Manager) ReportBug(ctx context.Context, req ReportBugReq, atts ...ReportBugAttachment) error {
	r := m.r(ctx).SetMultipartFormData(req.toFormData())

	for _, att := range atts {
		r = r.SetMultipartField(att.Name, att.Filename, string(att.MIMEType), bytes.NewReader(att.Body))
	}

	if _, err := r.Post("/core/v4/reports/bug"); err != nil {
		return err
	}

	return nil
}