23 lines
508 B
Go
23 lines
508 B
Go
package contracts
|
||
|
||
type GoBridgeService interface {
|
||
Start() error
|
||
Shutdown() error
|
||
Restart() error
|
||
}
|
||
|
||
// GoBridge 继承 Controller,可通过 gobridge.WithHandlers 绑定到 Pool,
|
||
// 所有公开方法自动暴露给 Python 通过 call_go() 调用。
|
||
type GoBridge interface {
|
||
_gobridge_handler()
|
||
Controller
|
||
}
|
||
|
||
// GoBridgeBase 嵌入到用户 struct 以实现 GoBridge 接口
|
||
type GoBridgeBase struct {
|
||
Controller
|
||
}
|
||
|
||
// _gobridge_handler 签名函数
|
||
func (bb *GoBridgeBase) _gobridge_handler() {}
|