33 lines
499 B
Go
33 lines
499 B
Go
package contracts
|
|
|
|
import (
|
|
"github.com/samber/do"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type GRpcService interface {
|
|
Start() error
|
|
Stop() error
|
|
Restart() error
|
|
}
|
|
|
|
type GRpc interface {
|
|
Controller
|
|
// 获取 gRPC 服务的描述信息
|
|
GetGRpcServiceDesc() *grpc.ServiceDesc
|
|
}
|
|
|
|
type GRpcBase struct {
|
|
Controller
|
|
}
|
|
|
|
func (GRpcBase) GetGRpcServiceDesc() *grpc.ServiceDesc {
|
|
return nil
|
|
}
|
|
|
|
func NewJGRpcBase(container *do.Injector) GRpc {
|
|
return &GRpcBase{
|
|
Controller: &BaseController{container},
|
|
}
|
|
}
|