Files
rpcx/server/router.go
2025-01-24 09:25:15 +08:00

15 lines
338 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package server
// UpdateHandler 批量更新router
// 服务器使用plugin热更时批量替换特定接口
func (s *Server) UpdateHandler(router map[string]Handler) {
newRouter := make(map[string]Handler)
for k, v := range s.router {
newRouter[k] = v
}
for k, v := range router {
newRouter[k] = v
}
s.router = newRouter
}