MCPcopy Index your code
hub / github.com/foxcpp/maddy / objectName

Function objectName

internal/msgpipeline/objname.go:29–46  ·  view source on GitHub ↗

objectName returns a new that is usable to identify the used external component (module or some stub) in debug logs.

(x interface{})

Source from the content-addressed store, hash-verified

27// objectName returns a new that is usable to identify the used external
28// component (module or some stub) in debug logs.
29func objectName(x interface{}) string {
30 mod, ok := x.(module.Module)
31 if ok {
32 return mod.Name() + ":" + mod.InstanceName()
33 }
34
35 _, pipeline := x.(*MsgPipeline)
36 if pipeline {
37 return "reroute"
38 }
39
40 str, ok := x.(fmt.Stringer)
41 if ok {
42 return str.String()
43 }
44
45 return fmt.Sprintf("%T", x)
46}

Callers 2

checkStatesMethod · 0.85
getDeliveryMethod · 0.85

Calls 3

NameMethod · 0.65
InstanceNameMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected