Documentation ¶
Index ¶
- Variables
- func CloseCtl()
- func Cobra(f func(rootCmd *cobra.Command))
- func SetName(name string)
- func Setup(startFunction ...StartFunc)
- func Shutdown()
- type BaseSandbox
- type Config
- type Ctl
- func (that *Ctl) CloseLogger(_ *string) (*Result, *drpc.Status)
- func (that *Ctl) Debug(debug *bool) (*Result, *drpc.Status)
- func (that *Ctl) Info(_ *string) (*Infos, *drpc.Status)
- func (that *Ctl) OpenLogger(level *int) (*Result, *drpc.Status)
- func (that *Ctl) Reload(name *string) (*Result, *drpc.Status)
- func (that *Ctl) Start(name *string) (*Result, *drpc.Status)
- func (that *Ctl) Stop(name *string) (*Result, *drpc.Status)
- type DServer
- func (that *DServer) AddSandBox(s ISandbox, services ...*DService) error
- func (that *DServer) BeforeStop(f StopFunc)
- func (that *DServer) Config() *gcfg.Config
- func (that *DServer) NewService(name string) *DService
- func (that *DServer) ProcessModel(model ProcessModel)
- func (that *DServer) SetInheritListener(address []InheritAddr)
- func (that *DServer) SetPidFile(pidFile string)
- func (that *DServer) Shutdown(timeout ...time.Duration)
- func (that *DServer) StartTime() *gtime.Time
- func (that *DServer) Version()
- type DService
- type ISandbox
- type Info
- func (*Info) Descriptor() ([]byte, []int)deprecated
- func (x *Info) GetDescription() string
- func (x *Info) GetSandBoxName() string
- func (x *Info) GetServiceName() string
- func (x *Info) GetStatus() string
- func (*Info) ProtoMessage()
- func (x *Info) ProtoReflect() protoreflect.Message
- func (x *Info) Reset()
- func (x *Info) String() string
- type Infos
- type InheritAddr
- type ProcessModel
- type Result
- type ServiceSandbox
- 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 = `` /* 265-byte string literal not displayed */ )
View Source
var File_ctl_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type BaseSandbox ¶
BaseSandbox sandbox的基类,必须继承它
type Config ¶
Config 配置文件对象
func (*Config) EndpointConfig ¶
func (that *Config) EndpointConfig(sandboxName ...string) drpc.EndpointConfig
EndpointConfig 通过配置文件获取配置信息
type Ctl ¶ added in v1.1.0
func (*Ctl) CloseLogger ¶ added in v1.1.0
CloseLogger 关闭日志流
func (*Ctl) OpenLogger ¶ added in v1.1.0
OpenLogger 开启日志流
type DServer ¶
type DServer struct {
// contains filtered or unexported fields
}
DServer 服务对象
func (*DServer) AddSandBox ¶
AddSandBox 添加sandbox到服务中 services 是可选,如果不传入则表示使用默认服务
func (*DServer) NewService ¶
NewService 创建新的服务 注意: 如果是多进程模式,则每个service表示一个进程
func (*DServer) ProcessModel ¶
func (that *DServer) ProcessModel(model ProcessModel)
ProcessModel 设置多进程模式 只有linux下才支持多进程模式
func (*DServer) SetInheritListener ¶
func (that *DServer) SetInheritListener(address []InheritAddr)
SetInheritListener 多进程模式下,设置要被继承的监听地址
type DService ¶
type DService struct {
// contains filtered or unexported fields
}
DService 服务对象,每个DService中可以存在多个sandbox 每个DServer中可以存在多个DService
type ISandbox ¶
ISandbox 服务沙盒的接口
func GetSandbox ¶ added in v1.2.0
GetSandbox 通过sandbox name 获取已注册的sandbox
type Info ¶
type Info struct { SandBoxName string `protobuf:"bytes,1,opt,name=SandBoxName,proto3" json:"SandBoxName,omitempty"` ServiceName string `protobuf:"bytes,2,opt,name=ServiceName,proto3" json:"ServiceName,omitempty"` Status string `protobuf:"bytes,3,opt,name=Status,proto3" json:"Status,omitempty"` Description string `protobuf:"bytes,4,opt,name=Description,proto3" json:"Description,omitempty"` // contains filtered or unexported fields }
func (*Info) Descriptor
deprecated
func (*Info) GetDescription ¶
func (*Info) GetSandBoxName ¶
func (*Info) GetServiceName ¶
func (*Info) ProtoMessage ¶
func (*Info) ProtoMessage()
func (*Info) ProtoReflect ¶
func (x *Info) ProtoReflect() protoreflect.Message
type Infos ¶
type Infos struct { List []*Info `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` // contains filtered or unexported fields }
func (*Infos) Descriptor
deprecated
func (*Infos) ProtoMessage ¶
func (*Infos) ProtoMessage()
func (*Infos) ProtoReflect ¶
func (x *Infos) ProtoReflect() protoreflect.Message
type InheritAddr ¶
type InheritAddr struct { Network string Host string Port int TlsConfig *tls.Config // ghttp服务专用 ServerName string }
InheritAddr master进程需要监听的配置
type ProcessModel ¶
type ProcessModel int
ProcessModel 进程模型
const ProcessModelMulti ProcessModel = 1
ProcessModelMulti 多进程模型
const ProcessModelSingle ProcessModel = 0
ProcessModelSingle 单进程模式
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) Descriptor
deprecated
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) ProtoReflect ¶
func (x *Result) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.