MCPcopy
hub / github.com/micro/go-micro / router

Struct router

server/rpc_router.go:55–78  ·  view source on GitHub ↗

router represents an RPC router.

Source from the content-addressed store, hash-verified

53
54// router represents an RPC router.
55type router struct {
56 ops RouterOptions
57
58 serviceMap map[string]*service
59
60 freeReq *request
61
62 freeResp *response
63
64 subscribers map[string][]*subscriber
65
66 // handler wrappers
67 hdlrWrappers []HandlerWrapper
68 // subscriber wrappers
69 subWrappers []SubscriberWrapper
70
71 su sync.RWMutex
72
73 mu sync.Mutex // protects the serviceMap
74
75 reqLock sync.Mutex // protects freeReq
76
77 respLock sync.Mutex // protects freeResp
78}
79
80// rpcRouter encapsulates functions that become a Router.
81type rpcRouter struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected