Documentation ¶
Overview ¶
实现文件 grpcserver 基于 grpc 实现的 rpc-server
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( errors.New("service not registered") )ErrServiceUnavailiable =
Functions ¶
func BuildWithOption ¶
Types ¶
type Option ¶
type Option func(*Parm)
Option config wraps
func AppendStreamInterceptors ¶
func AppendStreamInterceptors(interceptor grpc.StreamServerInterceptor) Option
func AppendUnaryInterceptors ¶
func AppendUnaryInterceptors(interceptor grpc.UnaryServerInterceptor) Option
func RegisterHandler ¶
func RegisterHandler(handler RegistHandler) Option
func WithGracefulStop ¶
func WithGracefulStop() Option
type Parm ¶
type Parm struct { ListenAddr string UnaryInterceptors []grpc.UnaryServerInterceptor StreamInterceptors []grpc.StreamServerInterceptor Handler RegistHandler GracefulStop bool }
Parm Service 配置
type RegistHandler ¶
Click to show internal directories.
Click to hide internal directories.