qservice

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 NewService

func NewService(setting *Setting) *MicroService

NewService 创建服务

func (*MicroService) Adapter added in v0.0.7

func (serv *MicroService) Adapter() easyCon.IAdapter

Adapter 获取访问器

func (*MicroService) ResetClient

func (serv *MicroService) ResetClient()

ResetClient 重置客户端

func (*MicroService) Run

func (serv *MicroService) Run()

Run 启动服务

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

func (serv *MicroService) SendRequest(module, route string, params any) (qdefine.Context, error)

SendRequest 向服务器其他模块发送请求,单机两者效果一致

func (*MicroService) Setting

func (serv *MicroService) Setting() Setting

Setting 获取设置

type Setting

type Setting struct {
	Mode    EServerMode          // 路由模式
	Module  string               // 模块服务名称
	Desc    string               // 模块服务描述
	Version string               // 模块服务版本
	DevCode string               // 设备码
	Broker  qdefine.BrokerConfig // 主服务配置
	// contains filtered or unexported fields
}

Setting 模块配置

func NewSetting

func NewSetting(moduleName, moduleDesc, version string) *Setting

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) BindStatusFunc added in v0.0.4

func (s *Setting) BindStatusFunc(onRetainNoticeHandler qdefine.NoticeHandler) *Setting

Jump to

Keyboard shortcuts

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