Documentation ¶
Index ¶
- Variables
- type AppStatus
- type ApplicationInfo
- type DefaultMasterClient
- func (m *DefaultMasterClient) GetModule(module string) *module.ServerSession
- func (m *DefaultMasterClient) GetModuleByByte(appByteName byte) *module.ServerSession
- func (m *DefaultMasterClient) RegisterToServer()
- func (m *DefaultMasterClient) SetShutDownCallBack(callback ShutDownCallBack)
- func (m *DefaultMasterClient) SetUpdateApplicationListCallBack(callback UpdateApplicationListCallBack)
- func (m *DefaultMasterClient) Shutdown()
- func (m *DefaultMasterClient) ToShutdown()
- type DefaultMasterServer
- func (m *DefaultMasterServer) GetAppList(name string) []ApplicationInfo
- func (m *DefaultMasterServer) GetAppStatus(name string) []AppStatus
- func (m *DefaultMasterServer) Register(info ApplicationInfo)
- func (m *DefaultMasterServer) ReportStatus(status AppStatus)
- func (m *DefaultMasterServer) UnRegister(appName string)
- type Master
- type MasterClient
- type ModuleStatus
- type OtherModuleInfo
- type ShutDownCallBack
- type UpdateApplicationListCallBack
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Register = "Register" //子服务器注册到主服务器 OnRegister = "OnRegister" //主服务器通知各个子服务器 UnRegister = "UnRegister" //子服务器通知到主服务器 OnUnRegister = "OnUnRegister" //主服务器通知各个子服务器 GetAppStatus = "GetAppStatus" //获得各个子服务器状态 ReportStatus = "ReportStatus" //子服务器报告自身状态 SyncVersionCode = "SyncVersionCode" //同步版本号 GetAppList = "GetAppList" //获得子服务器列表 MasterStr = "Master" //主服务器标志 UpdateStatus = "UpdateStatus" //主服务器同步子服务器状态 Bye = "Bye" UpdateInfo = "UpdateInfo" //主服务器要求子服务器重新注册· )
Functions ¶
This section is empty.
Types ¶
type AppStatus ¶
type AppStatus struct { AppName string Load int32 //用0到100 表示负载高低 ModuleStatus []ModuleStatus ProcessIngNumbers int32 //正在处理中的请求数量 }
type ApplicationInfo ¶
type ApplicationInfo struct { Name string RpcInfo string Modules map[string][]*conf.ModuleSettings }
type DefaultMasterClient ¶
type DefaultMasterClient struct { MasterClient Name string // contains filtered or unexported fields }
func NewMasterClient ¶
func (*DefaultMasterClient) GetModule ¶
func (m *DefaultMasterClient) GetModule(module string) *module.ServerSession
func (*DefaultMasterClient) GetModuleByByte ¶
func (m *DefaultMasterClient) GetModuleByByte(appByteName byte) *module.ServerSession
func (*DefaultMasterClient) RegisterToServer ¶
func (m *DefaultMasterClient) RegisterToServer()
func (*DefaultMasterClient) SetShutDownCallBack ¶
func (m *DefaultMasterClient) SetShutDownCallBack(callback ShutDownCallBack)
func (*DefaultMasterClient) SetUpdateApplicationListCallBack ¶
func (m *DefaultMasterClient) SetUpdateApplicationListCallBack(callback UpdateApplicationListCallBack)
func (*DefaultMasterClient) Shutdown ¶
func (m *DefaultMasterClient) Shutdown()
func (*DefaultMasterClient) ToShutdown ¶
func (m *DefaultMasterClient) ToShutdown()
type DefaultMasterServer ¶
type DefaultMasterServer struct { Master Modules map[string][]OtherModuleInfo // contains filtered or unexported fields }
func (*DefaultMasterServer) GetAppList ¶
func (m *DefaultMasterServer) GetAppList(name string) []ApplicationInfo
func (*DefaultMasterServer) GetAppStatus ¶
func (m *DefaultMasterServer) GetAppStatus(name string) []AppStatus
func (*DefaultMasterServer) Register ¶
func (m *DefaultMasterServer) Register(info ApplicationInfo)
func (*DefaultMasterServer) ReportStatus ¶
func (m *DefaultMasterServer) ReportStatus(status AppStatus)
func (*DefaultMasterServer) UnRegister ¶
func (m *DefaultMasterServer) UnRegister(appName string)
type Master ¶
type Master interface { Register(info ApplicationInfo) //服务注册到master UnRegister(appName string) //解除注册 GetAppStatus(name string) []AppStatus // 获取可用服务状态 GetAppList(name string) []ApplicationInfo ReportStatus(status AppStatus) // 报告状态 }
type MasterClient ¶
type MasterClient interface { SetShutDownCallBack(callback ShutDownCallBack) //注册远程关闭回调 SetUpdateApplicationListCallBack(callback UpdateApplicationListCallBack) //注册更新服务器列表回调 GetModule(module string) *module.ServerSession //获取可用模块RPC信息 GetModuleByByte(appByteName byte) *module.ServerSession //根据byte编号获取可用模块RPC信息 Shutdown() //关闭服务 ToShutdown() //主服务器关闭本服务 }
type ModuleStatus ¶
type OtherModuleInfo ¶
type OtherModuleInfo struct {
// contains filtered or unexported fields
}
type ShutDownCallBack ¶
type ShutDownCallBack func() //关闭某个服务
type UpdateApplicationListCallBack ¶
type UpdateApplicationListCallBack func() // 更新服务器列表
Click to show internal directories.
Click to hide internal directories.