Documentation
¶
Index ¶
- func NewGateway() *runtime.ServeMux
- func NewGrpc(grpcOptions []grpc.ServerOption) *grpcServer
- func NewHttp(config *config.Config, grpc *grpc.Server) *httpServer
- type Core
- func (core *Core) AddOption(options grpc.ServerOption)
- func (core *Core) GetGrpcServer() *grpcServer
- func (core *Core) GetHttpServer() *httpServer
- func (core *Core) Run() error
- func (core *Core) SetReflectionStatus(status bool)
- func (core *Core) SetStreamInterceptors(interceptors []grpc.StreamServerInterceptor)
- func (core *Core) SetUnaryInterceptors(interceptors []grpc.UnaryServerInterceptor)
- func (core *Core) WaitTermination(stopHook func())
- type GrpcServer
- type HttpServer
- type MetricServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGateway ¶
func NewGrpc ¶
func NewGrpc(grpcOptions []grpc.ServerOption) *grpcServer
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
* @desc : trpc核心struct结构体
func (*Core) AddOption ¶
func (core *Core) AddOption(options grpc.ServerOption)
* @desc : 追加grpc options属性
func (*Core) GetGrpcServer ¶
func (core *Core) GetGrpcServer() *grpcServer
func (*Core) GetHttpServer ¶
func (core *Core) GetHttpServer() *httpServer
func (*Core) SetReflectionStatus ¶
* @desc : 设置grpc的reflection状态
func (*Core) SetStreamInterceptors ¶
func (core *Core) SetStreamInterceptors(interceptors []grpc.StreamServerInterceptor)
* @desc : 添加Stream拦截器,这里使用grpc官方标准ChainStreamInterceptor
func (*Core) SetUnaryInterceptors ¶
func (core *Core) SetUnaryInterceptors(interceptors []grpc.UnaryServerInterceptor)
* @desc : 添加Unray拦截器,这里使用grpc官方标准ChainUnaryInterceptor
func (*Core) WaitTermination ¶
func (core *Core) WaitTermination(stopHook func())
* @desc : 主协程在阻塞等待保证不退出,等待系统信号来终止服务
type GrpcServer ¶
type GrpcServer interface { Run() error Stop() RegisterService() GetListenSocket() net.Listener GetRawGrpcServer() *grpc.Server }
* @desc : 声明一个gRPC interface接口
type HttpServer ¶
type HttpServer interface { GetRawHttpServer() GetGatewayMux() }
type MetricServer ¶
type MetricServer struct {
// contains filtered or unexported fields
}
func NewMetric ¶
func NewMetric() *MetricServer
func (*MetricServer) Run ¶
func (mSvr *MetricServer) Run()
func (*MetricServer) Stop ¶
func (mSvr *MetricServer) Stop()
Click to show internal directories.
Click to hide internal directories.