1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00

fix: struct field alignment (#2632)

This commit is contained in:
Lukasz Raczylo
2023-04-26 00:16:34 +00:00
committed by GitHub
parent 0f9b2f00c9
commit a7522e7d6c
113 changed files with 694 additions and 637 deletions

View File

@ -26,19 +26,19 @@ var (
)
type methodType struct {
sync.Mutex // protects counters
method reflect.Method
ArgType reflect.Type
ReplyType reflect.Type
ContextType reflect.Type
method reflect.Method
sync.Mutex // protects counters
stream bool
}
type service struct {
name string // name of service
rcvr reflect.Value // receiver of methods for the service
typ reflect.Type // type of the receiver
method map[string]*methodType // registered methods
rcvr reflect.Value // receiver of methods for the service
name string // name of service
}
type request struct {
@ -53,25 +53,29 @@ type response struct {
// router represents an RPC router.
type router struct {
name string
ops RouterOptions
ops RouterOptions
mu sync.Mutex // protects the serviceMap
serviceMap map[string]*service
reqLock sync.Mutex // protects freeReq
freeReq *request
respLock sync.Mutex // protects freeResp
freeResp *response
subscribers map[string][]*subscriber
name string
// handler wrappers
hdlrWrappers []HandlerWrapper
// subscriber wrappers
subWrappers []SubscriberWrapper
su sync.RWMutex
subscribers map[string][]*subscriber
su sync.RWMutex
mu sync.Mutex // protects the serviceMap
reqLock sync.Mutex // protects freeReq
respLock sync.Mutex // protects freeResp
}
// rpcRouter encapsulates functions that become a Router.