Documentation ¶
Index ¶
- func GetErrors(moduleName string, lineCount int) string
- type Args
- type EServerMode
- type LogConfig
- type MicroService
- func (serv *MicroService) Adapter() easyCon.IAdapter
- func (serv *MicroService) ResetClient()
- func (serv *MicroService) Run()
- func (serv *MicroService) SendAlarm(alarmType string, alarmValue string) error
- func (serv *MicroService) SendLog(logType qdefine.ELog, content string, err error)
- func (serv *MicroService) SendNotice(route string, content any)
- func (serv *MicroService) SendRequest(module, route string, params any) (qdefine.Context, error)
- func (serv *MicroService) Setting() Setting
- func (serv *MicroService) Stop()
- type Setting
- func (s *Setting) BindCommStateFunc(onStateHandler qdefine.StateHandler) *Setting
- func (s *Setting) BindInitFunc(onInitHandler qdefine.InitHandler) *Setting
- func (s *Setting) BindNoticeFunc(onNoticeHandler qdefine.NoticeHandler) *Setting
- func (s *Setting) BindReqFunc(onReqHandler qdefine.ReqHandler) *Setting
- func (s *Setting) BindRespDetectedFunc(onDetectedHandler qdefine.DetectedHandler) *Setting
- func (s *Setting) ReloadByCustomArgs(args Args)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EServerMode ¶ added in v0.0.7
type EServerMode string
const ( EModeClient EServerMode = "client" EModeServer EServerMode = "server" )
func (EServerMode) IsClient ¶ added in v0.0.7
func (mode EServerMode) IsClient() bool
func (EServerMode) IsServer ¶ added in v0.0.7
func (mode EServerMode) IsServer() bool
type MicroService ¶
type MicroService struct {
// contains filtered or unexported fields
}
func (*MicroService) Adapter ¶ added in v0.0.7
func (serv *MicroService) Adapter() easyCon.IAdapter
Adapter 获取访问器
func (*MicroService) SendAlarm ¶ added in v0.0.8
func (serv *MicroService) SendAlarm(alarmType string, alarmValue string) error
func (*MicroService) SendLog ¶
func (serv *MicroService) SendLog(logType qdefine.ELog, content string, err error)
SendLog 发送日志
func (*MicroService) SendNotice ¶
func (serv *MicroService) SendNotice(route string, content any)
SendNotice 发送通知
func (*MicroService) SendRequest ¶
SendRequest 向服务器其他模块发送请求,单机两者效果一致
type Setting ¶
type Setting struct { Mode EServerMode // 路由模式 Module string // 模块服务名称 Desc string // 模块服务描述 Version string // 模块服务版本 DevCode string // 设备码 Broker qdefine.BrokerConfig // 主服务配置 DetectedRoutes []string // 需要对外暴露的方法列表 // contains filtered or unexported fields }
Setting 模块配置
func NewSetting ¶
NewSetting 创建模块配置
func (*Setting) BindCommStateFunc ¶ added in v0.0.4
func (s *Setting) BindCommStateFunc(onStateHandler qdefine.StateHandler) *Setting
func (*Setting) BindInitFunc ¶
func (s *Setting) BindInitFunc(onInitHandler qdefine.InitHandler) *Setting
func (*Setting) BindNoticeFunc ¶
func (s *Setting) BindNoticeFunc(onNoticeHandler qdefine.NoticeHandler) *Setting
func (*Setting) BindReqFunc ¶
func (s *Setting) BindReqFunc(onReqHandler qdefine.ReqHandler) *Setting
func (*Setting) BindRespDetectedFunc ¶ added in v0.0.8
func (s *Setting) BindRespDetectedFunc(onDetectedHandler qdefine.DetectedHandler) *Setting
func (*Setting) ReloadByCustomArgs ¶ added in v0.0.8
Click to show internal directories.
Click to hide internal directories.