MCPcopy
hub / github.com/kopia/kopia / Send

Method Send

notification/sender/jsonsender/jsonsender.go:21–37  ·  view source on GitHub ↗
(_ context.Context, msg *sender.Message)

Source from the content-addressed store, hash-verified

19}
20
21func (p *jsonSender) Send(_ context.Context, msg *sender.Message) error {
22 if msg.Severity < p.minSeverity {
23 return nil
24 }
25
26 var buf bytes.Buffer
27
28 buf.WriteString(p.prefix)
29
30 if err := json.NewEncoder(&buf).Encode(msg); err != nil {
31 return errors.Wrap(err, "unable to encode JSON")
32 }
33
34 _, err := p.out.Write(buf.Bytes())
35
36 return err //nolint:wrapcheck
37}
38
39func (p *jsonSender) Summary() string {
40 return "JSON sender"

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected