Documentation ¶
Index ¶
- Variables
- func GetNextSandBoxId() int
- func Iterator(f func(sandboxId int, sandbox ISandBox))
- func RemoveSandBox(sandBoxID int) error
- func SetHelpContent(content string)
- func SetOption(key string, v bool)
- func SetOptions(opt map[string]bool)
- func SetSandBox(box ISandBox)
- func Setup(startFunction StartFunc)
- func Shutdown()
- type BoxConf
- type EasyService
- func (that *EasyService) AddSandBox(s ISandBox)
- func (that *EasyService) BeforeStop(f StopFunc)
- func (that *EasyService) CmdParser() *gcmd.Parser
- func (that *EasyService) Config() *gcfg.Config
- func (that *EasyService) GetSandBox(id int) ISandBox
- func (that *EasyService) Help()
- func (that *EasyService) SandboxNames() *garray.StrArray
- func (that *EasyService) SetPidFile(pidFile string)
- func (that *EasyService) Setup(startFunction StartFunc)
- func (that *EasyService) Shutdown(timeout ...time.Duration)
- func (that *EasyService) StartTime() *gtime.Time
- func (that *EasyService) Version()
- type ISandBox
- type StartFunc
- type StopFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BuildVersion = "No Version Info" BuildGoVersion = "No Version Info" BuildGitCommitId = "No Commit Info" BuildTime = "No Time Info" Authors = "No Authors Info" Logo = `` /* 220-byte string literal not displayed */ )
Deprecated
Functions ¶
Types ¶
type BoxConf ¶
type BoxConf struct { SandBoxName string `json:"sandbox_name" comment:"服务沙盒的名字"` Network string `json:"network" comment:"使用的网络协议; tcp, tcp4, tcp6,kcp,quic,unix or unixpacket"` ListenAddress string `json:"listen_address" comment:"监听地址"` PrintDetail bool `json:"print_detail" comment:"是否显示通讯详情"` SessionMaxTimeout time.Duration `json:"session_max_timeout" comment:"会话生命周期"` ResponseMaxTimeout time.Duration `json:"response_max_timeout" comment:"单次处理响应最长超时时间"` SlowTimeout time.Duration `json:"slow_timeout" comment:"慢请求时间"` RequestMaxTimeout time.Duration `json:"request_max_timeout" comment:"请求最长超时时间"` RedialTimes int `` /* 126-byte string literal not displayed */ RedialInterval time.Duration `json:"redial_interval" comment:"仅限客户端角色使用 试图链接服务端时候,重试的时间间隔"` // contains filtered or unexported fields }
Deprecated
func DefaultBoxConf ¶
DefaultBoxConf 创建运行配置 Deprecated
func NewBoxConf ¶
NewBoxConf 创建BoxConf对象 Deprecated
func (*BoxConf) EndpointConfig ¶
func (that *BoxConf) EndpointConfig() drpc.EndpointConfig
EndpointConfig 返回rpc服务要用的配置文件 Deprecated
type EasyService ¶
type EasyService struct {
// contains filtered or unexported fields
}
EasyService 服务对象
func (*EasyService) AddSandBox ¶
func (that *EasyService) AddSandBox(s ISandBox)
func (*EasyService) BeforeStop ¶
func (that *EasyService) BeforeStop(f StopFunc)
BeforeStop 设置服务重启方法
func (*EasyService) GetSandBox ¶
func (that *EasyService) GetSandBox(id int) ISandBox
GetSandBox 获取指定的服务沙盒
func (*EasyService) SandboxNames ¶ added in v0.3.2
func (that *EasyService) SandboxNames() *garray.StrArray
SandboxNames 获取当前需要启动的服务沙盒,如果为空,则表示未传入
func (*EasyService) SetPidFile ¶
func (that *EasyService) SetPidFile(pidFile string)
SetPidFile 设置pid文件
func (*EasyService) Setup ¶
func (that *EasyService) Setup(startFunction StartFunc)
Setup 启动服务,并执行传入的启动方法 Deprecated
func (*EasyService) Shutdown ¶
func (that *EasyService) Shutdown(timeout ...time.Duration)
Shutdown 主动结束进程
func (*EasyService) Version ¶ added in v0.6.2
func (that *EasyService) Version()
Version 显示版本信息 Deprecated
Click to show internal directories.
Click to hide internal directories.