Documentation
¶
Index ¶
- Constants
- func Uint32SliceDeduplicateSorted(s []uint32) []uint32
- type ServerInstanceMgr
- func (s *ServerInstanceMgr) Close()
- func (s *ServerInstanceMgr) GetAllSvrInsBySvrType(severType uint32) []uint32
- func (s *ServerInstanceMgr) GetSvrInsBySvrType(serverType uint32, uid uint64) uint32
- func (s *ServerInstanceMgr) InitAndRun(selfBusID string, routeRules map[uint32]uint32, zookeeperAddr string) error
Constants ¶
View Source
const ( SvrRouterRule_Random = 1 + iota // 随机路由 SvrRouterRule_UID // 根据UID取模 SvrRouterRule_Master )
路由方法
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ServerInstanceMgr ¶
type ServerInstanceMgr struct {
// contains filtered or unexported fields
}
func (*ServerInstanceMgr) Close ¶
func (s *ServerInstanceMgr) Close()
func (*ServerInstanceMgr) GetAllSvrInsBySvrType ¶
func (s *ServerInstanceMgr) GetAllSvrInsBySvrType(severType uint32) []uint32
根据svrtype获取所有的svrinstance
func (*ServerInstanceMgr) GetSvrInsBySvrType ¶
func (s *ServerInstanceMgr) GetSvrInsBySvrType(serverType uint32, uid uint64) uint32
根据ServerType和预先设定的RouterRule,获取一个ServerInstance
func (*ServerInstanceMgr) InitAndRun ¶
func (s *ServerInstanceMgr) InitAndRun(selfBusID string, routeRules map[uint32]uint32, zookeeperAddr string) error
parameters:
routeRules: ServerType->SvrRouterRule
Click to show internal directories.
Click to hide internal directories.