MCPcopy Create free account
hub / github.com/pion/rtcp / stringify

Function stringify

packet_stringifier.go:33–37  ·  view source on GitHub ↗

* Converts an RTCP Packet into a human-readable format. The Packets themselves can control the presentation as follows: - Fields of a type that have a String() method will be formatted with that String method (which should not emit '\n' characters) - Otherwise, fields with a tag containing

(p Packet)

Source from the content-addressed store, hash-verified

31baseline implementation that works well in the majority of cases.
32*/
33func stringify(p Packet) string {
34 value := reflect.Indirect(reflect.ValueOf(p))
35
36 return formatField(value.Type().String(), "", p, "")
37}
38
39//nolint:gocognit,cyclop
40func formatField(name string, format string, f any, indent string) string {

Callers 3

StringMethod · 0.85
StringMethod · 0.85
TestPrintFunction · 0.85

Calls 3

formatFieldFunction · 0.85
TypeMethod · 0.80
StringMethod · 0.45

Tested by 1

TestPrintFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…