svrinstmgr

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SvrRouterRule_Random = 1 + iota // 随机路由
	SvrRouterRule_UID               // 根据UID取模
	SvrRouterRule_Master
)

路由方法

Variables

This section is empty.

Functions

func Uint32SliceDeduplicateSorted

func Uint32SliceDeduplicateSorted(s []uint32) []uint32

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL