MCPcopy
hub / github.com/puma/puma-dev / Add

Method Add

dev/events.go:16–36  ·  view source on GitHub ↗
(name string, args ...interface{})

Source from the content-addressed store, hash-verified

14}
15
16func (e *Events) Add(name string, args ...interface{}) string {
17 var buf bytes.Buffer
18
19 buf.WriteString("{")
20
21 fmt.Fprintf(&buf, `"time":"%s","event":"%s"`, time.Now(), name)
22
23 for i := 0; i < len(args); i += 2 {
24 k := args[i]
25 v := args[i+1]
26 fmt.Fprintf(&buf, `,"%s":%#v`, k, v)
27 }
28
29 buf.WriteString("}\n")
30
31 str := buf.String()
32
33 e.events.Append(str)
34
35 return str
36}
37
38func (e *Events) WriteTo(w io.Writer) (int64, error) {
39 return e.events.WriteTo(w)

Callers 8

ServeHTTPMethod · 0.80
GetCertificateMethod · 0.80
makeCertFunction · 0.80
eventAddMethod · 0.80
lookupAppMethod · 0.80
PurgeMethod · 0.80
WatchFunction · 0.80

Calls 1

AppendMethod · 0.80

Tested by

no test coverage detected